Skip to content

Extension declarations do not show up #22

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

Open
ruiaraujo opened this issue Jan 30, 2019 · 5 comments
Open

Extension declarations do not show up #22

ruiaraujo opened this issue Jan 30, 2019 · 5 comments
Labels
blocked bug Something isn't working

Comments

@ruiaraujo
Copy link

We are using the -s option with a SDL language file.

This file is a concat of multiple separate files which use the extend Type syntax to extend the Query type.

Unfortunately, these do not show up in the docs.

@mitchellsimoens
Copy link

Hey, thanks for using this project and reporting a bug. Would you happen to have a simple test case that I can debug?

@mitchellsimoens mitchellsimoens added bug Something isn't working question Further information is requested labels Jan 30, 2019
@ruiaraujo
Copy link
Author

Try this file

type Query {
  version: String!
  name: String!
}

extend type Query {
  hello: String!
}

@mitchellsimoens
Copy link

Thanks for that simple sample. Walking through the code, I actually think this is a bug with graphql creating an ast. I can see where it adds the type (and checks for any directives) but I don't see where it's handling extensions. I'm going to find some time to create a test outside of this project to see if it is a bug of theirs and that way I can submit a bug report.

I will go ahead and see what you would expect here for this project. Would you like to just see the hello field with the other two fields in the type code block or something special to show it was added in via extension?

@mitchellsimoens
Copy link

Yes, looks like this is an upstream bug in graphql-js. There is this issue that discusses extension and the ast being built not including it but looks like they want to throw an error in that simple case.

However, I don't see why a type extension like your simple example shouldn't just work so I opened this: graphql/graphql-js#1701

@mitchellsimoens
Copy link

So good news, they are refactoring some things and one of the things they are doing is handling the extension stuff properly and plan on having that done for their next major release which is good! I'll keep this open so I'll circle around when they get their issue fixed.

@mitchellsimoens mitchellsimoens added blocked and removed question Further information is requested labels Feb 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants