-
-
Notifications
You must be signed in to change notification settings - Fork 816
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
[Feature] Support lexical parser options #567
Conversation
afd9ed8
to
776ec66
Compare
Sorry for update spam, github was misbehaving with conflict resolution. This fails because graphql-js haven't released version with those changes yet. I'll merge it once it's released. |
Thanks for reviewing, I'll keep an eye out for the next release of |
Has the upstream stuff been published yet? |
Not yet, it's been over a month since last release of graphql-js |
Release should be coming soon: |
This adds the ability to specify `parseOptions` through makeExecutableSchema into graphql.parse - unlocking finer control of lexical options when building a schema.
d893cca
to
6056eb3
Compare
GraphQL-JS @ 0.13.0 has released I rebased my PR from master, updated the package versions, and ran tests again (passing locally ✅) |
@colepatrickturner I get typescript errors locally atm:
|
Other stuff this PR needs:
|
(Though we could possibly split the above into "support 0.13" PR) |
Woops I forgot to push it yesterday. Will go through the checklist |
46695aa
to
5a93b66
Compare
With the versioning matrix, I wrote it such that |
@colepatrickturner Thank you so much for handling this! Waiting for the TS to merge and I'll release. |
…r/graphql-tools into colepatrickturner-ct/parser-options
@colepatrickturner Could you enable me to push to your branch? I have fixes that make tests pass. |
@freiksenet I have added you as a contributor to my fork |
Urgh, there is issue with graphql-subscriptions not supporting 0.13 yet, so non-v5 npm fails. Waiting for this to land. apollographql/graphql-subscriptions#135 |
(╯°□°)╯︵ ┻━┻ Now it works. |
This adds the ability to specify
parseOptions
through makeExecutableSchema into graphql.parse - unlocking finer control of lexical options when building a schema.Motivation
I'm working with tooling where I would like to be able to parse an empty schema
Query
type. As of today, it's not possible withgraphql-tools
because types must have at least one field. This is possible withgraphql
currently in master, albeit as of now those options are legacy or experimental feature flags. There are other use cases, such asnoLocation
which can be used to optimize AST building. It's nice to have these options as they are now and possibly what may be added in the future.Creating this pull request for consideration once the master branch and all current options are deployed to NPM.
What's changed
parseOptions
tomakeExecutableSchema
parametersparseOptions
frommakeExecutableSchema
tographql/parse
Current options supported:
Example
Related
graphql/graphql-js#1171
graphql/graphql-js@c496fb7
graphql/graphql-js@ce0a4b9
Tasks
If this PR is a new feature, reference an issue where a consensus about the design was reached (not necessary for small changes)