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 Descriptions #72
Comments
The GraphQL schema language doesn't support descriptions at the moment (only deprecation, via decorators), but you can do it via resolvers. Check out this test to see how it works: https://github.com/apollostack/graphql-tools/blob/00d01eba94e8dbd21973e71b3cfd4361fdd8961d/test/testSchemaGenerator.js#L389 If you want to set a description on a type (as opposed to a field), you can do that by adding a |
That doesn't seem bad, thanks! |
Also, thank you so much for the lightning responses Jonas, you're awesome! |
This was added in graphql/graphql-js#464 and now works as a # comment in the schema string: https://github.com/apollostack/GitHunt-API/blob/master/api/schema.js#L9 |
I found a weird behavior, probably it deserves another bug, but I think I should start here. When schema definition is wrapped in I am using
And here's what is returned by introspection query: All description fields are empty... Apollo server creation code: const typeDefs = readFileSync(path.join(__dirname, 'src', 'apollo', 'schema.graphqls')).toString();
export const apolloServer = new ApolloServer({
typeDefs: gql`${typeDefs}`,
resolvers,
introspection: true,
tracing: true,
context: ({req}) => ({
authHeader: req.headers['authheader']
})
}); If I replace
... with
... it starts to work as expected. |
same issue with @kirill-konshin ... don't know it's designed by that or it's an issue. Could we create another issue for this? |
Hello guys, I'm trying to find a way to include schema descriptions (the ones that pop out in Graphiql)
I know the graphql-js way, but couldn't figure out how to do it in Apollo.
The text was updated successfully, but these errors were encountered: