Replace resolved types in lexicographic schema sort#2779
Replace resolved types in lexicographic schema sort#2779mattleff wants to merge 3 commits intographql:masterfrom
Conversation
|
@mattleff Very interesting bug, once review comments are addressed I will merge it as a temporary fix. |
|
@mattleff Thinking more about it it's better to have this temporary workaround directly inside |
|
@IvanGoncharov Ok, I'll see if I can implement it in |
|
@IvanGoncharov I've pushed that change. Are you good with the current tests or is there a better place or method for testing this? |
|
@mattleff Midnight in my location 🛏️ |
|
@mattleff You can use our NPM branch for tests: |
|
@IvanGoncharov That works great. Thanks for all your work to square this away! |
When using
lexicographicSortSchema()with a schema containingresolveTypefor either interfaces or unions the resolved type wasn't being replaced with the newGraphQLObjectTypecreated during sorting. This PR wraps anyresolveTypefunctions provided and substitutes the sorted named type for the type returned from theresolveTypefunction.Downstream issue: nestjs/graphql#1107