graphql.github.io
graphql.github.io copied to clipboard
Docs :: GraphQLResult is not defined
Description
The API doc for the graphql() function says it returns Promise<GraphQLResult>. But GraphQLResult is not defined, and does not exist in the code base AFAICT.
Motivation
Completeness, accuracy.
Good catch. ExecutionResult is what is returned. Docs for graphql-js are outdated on this site as well as in graphql-js/docs. We are currently migrating to TypeScript. Generating docs (using ts docs or other tools) and providing more examples is next task in v16 release plan
We are currently migrating to TypeScript.
OK cool. Since then I've noticed a bunch of other inconsistencies in those docs. Like for example the docs say GraphQlSchemaConfig looks like this:
type GraphQLSchemaConfig = {
query: GraphQLObjectType;
mutation?: ?GraphQLObjectType;
}
when it's actually this on master:
export type GraphQLSchemaConfig = {|
description?: ?string,
query?: ?GraphQLObjectType,
mutation?: ?GraphQLObjectType,
subscription?: ?GraphQLObjectType,
types?: ?Array<GraphQLNamedType>,
directives?: ?Array<GraphQLDirective>,
extensions?: ?ReadOnlyObjMapLike<mixed>,
astNode?: ?SchemaDefinitionNode,
extensionASTNodes?: ?$ReadOnlyArray<SchemaExtensionNode>,
...GraphQLSchemaValidationOptions,
|};
Since it's a wip I won't bother making anymore issues for docs. Feel free to close this if you want.
Cheers.