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

Documentation for explicitly mentioning ObjectTypes #1679

Merged
merged 6 commits into from
Jan 29, 2019
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/type/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@ export function assertSchema(schema: mixed): GraphQLSchema {
* directives: specifiedDirectives.concat([ myCustomDirective ]),
* })
*
* Note: ObjectTypes which do not have their own queries in the Schema will not end up
* in the final Schema. To achieve this, You need to explicitly mention the ObjectType
* while creating the Schema. Example:
elevenpassin marked this conversation as resolved.
Show resolved Hide resolved
*
* const schema = new GraphQLSchema({
* types: [CarType],
* ...
* })
*
elevenpassin marked this conversation as resolved.
Show resolved Hide resolved
*/
export class GraphQLSchema {
astNode: ?SchemaDefinitionNode;
Expand Down