# JavaScript
Generates all the types needed for implementing a GraphQL service in JavaScript. All types are generated to work with github.com/graphql/graphql-js.
# Output
Input:
schema {
query: Query
}
"Query represents the queries this example provides."
type Query {
hello: String
}
Output:
var {
GraphQLSchema,
GraphQLObjectType,
GraphQLString
} = require('graphql');
var Schema = new GraphQLSchema({
query: Query
});
var QueryType = new GraphQLObjectType({
name: 'Query',
fields: {
hello: {
type: GraphQLString,
resolve() { /* TODO */ }
}
}
});
# Options
# descriptions
Type:
Boolean
Default:
false
Keep descriptions in generated output.
# module
Type:
Enum
Default:
COMMONJS
Values:
COMMONJS
ES6
Specify the Javascript module import style.
# useFlow
Type:
Boolean
Default:
false
Add flow comment.