graphql.github.io icon indicating copy to clipboard operation
graphql.github.io copied to clipboard

Docs :: GraphQLResult is not defined

Open sgpinkus opened this issue 4 years ago • 2 comments

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.

sgpinkus avatar May 09 '21 01:05 sgpinkus

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

saihaj avatar May 09 '21 01:05 saihaj

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.

sgpinkus avatar May 09 '21 14:05 sgpinkus