Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[schema] Add schema query tests, inference fixes #12190

Merged

Conversation

stefanprobst
Copy link
Contributor

@stefanprobst stefanprobst commented Feb 28, 2019

This is for #11480

Adds:

  • more query tests
  • test for merging inferred field types
  • some test todos
  • added JSdoc

Fixes:

  • ensure schema composer has Node interface
  • make noDefaultResolvers: true mean addDefaultResolvers: false
  • rebuild with SitePage context now works correctly. A more general solution for on-demand schema rebuild would still require a bit more work.
  • merging nested types in inference: because we now guarantee priority when we have conflicting field names, we have to deal with temporary TypeComposers on nested fields. Also ensure that we honor array depth; and get the nested TC's name from an existing TC, not from createSelector.
  • make sorting work (lowercase sort order enum) -- this has triggered another Loki mismatch (it is the same issue with null values on indexed fields: the kitchen sink query sorts DESC on likes, which sorts nulls to the front, and those screw things up. It is good that we know this, and we should find a solution, but it's an edge case. The easiest "fix" for now would be to adjust sort order in kitchen sink query from DESC to ASC and update the snapshot. EDIT: I now did just that.

@stefanprobst stefanprobst requested a review from a team as a code owner February 28, 2019 19:48
@freiksenet
Copy link
Contributor

LGTM, do you want to add TODO tests on this branch or separately? Anyway, you can merge it if you want.

@stefanprobst stefanprobst merged commit a1c01a6 into gatsbyjs:schema-refactor-new Mar 1, 2019
@stefanprobst stefanprobst deleted the schema-query-tests branch July 8, 2019 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants