-
Notifications
You must be signed in to change notification settings - Fork 2k
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
How does type extension work? #483
Comments
Hey @tonyxiao, can you please post the code you're running to execute type extension? |
Hmm I was using it together with ApolloStack. apollostack.com Maybe they are using an older version of graphql js and that's why there's error? |
Sounds like it should be an issue on graphql-tools? https://github.com/apollostack/graphql-tools I'd close the one here. |
Closing this since I haven't seen any movement on this for a while. @tonyxiao, please feel free to re-open if feel there's something specific and actionable we can do in this repo. |
feel free to open an issue on graphql tools about documenting this. |
I'm still seeing import { buildSchema, graphql } from 'graphql';
const schema = buildSchema(`
type QuerySubset {
hello: String
}
type Queries {
querySubset: QuerySubset
}
extend type Queries {
hello: String
}
type Query {
Queries: Queries
}
schema {
query: Query
}
`)
const rootResolver = {
Queries: {
querySubset: {
hello: () => 'hello world',
},
hello: () => 'hello world',
}
};
// Works fine
graphql(schema, `{ Queries { querySubset { hello } } }`, rootResolver).then(response => {
console.log(response);
})
// Errors out with 'Cannot query field "hello" on type "Queries".'
graphql(schema, `{ Queries { hello } }`, rootResolver).then(response => {
console.log(response);
}) |
Why is this closed? I would like to know how the |
@krabbypattified See the closed issue #892 and associated issue #922 |
TL;DR - use graphql-tools for now. |
I see some commits that adds the following syntax
However I can't find any docs around just what it is and how to use it. And if I actually try to use it in code I get the following message.
Can someone clarify how to use type extension in GraphQL?
The text was updated successfully, but these errors were encountered: