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

Bug in parser: "extend type" declaration breaks parser #166

Closed
nemanja-stanarevic opened this issue Sep 2, 2015 · 4 comments
Closed

Bug in parser: "extend type" declaration breaks parser #166

nemanja-stanarevic opened this issue Sep 2, 2015 · 4 comments

Comments

@nemanja-stanarevic
Copy link
Contributor

Adding the following test to schema kitchen sink breaks the print test (visitor throws "Invalid AST Node")-

extend type Foo {
  seven(argument: [String]): Type
}

Root cause is a typo in the parser code - parser currently imports TYPE_EXTENTION_DEFINITION (instead of TYPE_EXTENSION_DEFINITION). This causes parseTypeExtensionDefinition to return a TypeExtensionDefinition value with kind field undefined, which in turn causes visitor to throw "Invalid AST Node".

I will submit a PR with the patch and updated test case shortly.

leebyron added a commit that referenced this issue Sep 9, 2015
Fixed the issue #166 related to parsing of 'extend type' declaration
@leebyron
Copy link
Contributor

leebyron commented Sep 9, 2015

Thanks for the investigation and fix!

@leebyron leebyron closed this as completed Sep 9, 2015
@tjwebb
Copy link

tjwebb commented Oct 25, 2016

Where is this extend documented? I see it mentioned only as an afterthought in the spec.

@leebyron
Copy link
Contributor

It's experimental right now and thus has limited documentation. There's a proposal to add it to the spec.

@tjwebb
Copy link

tjwebb commented Oct 25, 2016

How is it used? I'd like to be able to extend Query so that I don't need to define all of my root queries in one place.

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

No branches or pull requests

3 participants