This task seeks to track all feedback on the GraphQL type definition API. Once enough feedback has been collected to project a clear course of action, a new type definition API will be proposed, and implemented in a following major version with clear instructions for moving along existing code.
As stated in #130, the way types are exported is problematic:
import {
GraphQLObjectType,
GraphQLNonNull,
GraphQLString,
} from 'graphql';
graphql-js should export a Types object which contains all the types without the "GraphQL" prefix:
import { Types as GqlTypes } from 'graphql';
// GqlTypes.ObjectType
// GqlTypes.NonNull
// GqlTypes.String
We can add the "Types" export without breaking 0.4 and remove prefixed types in 0.5.
I think we stabilize our Type Definition API enough over the last 3 years.
So if someone wants to report any issue with it should be reported separately.
As for having separate Types I think schema definition methods are shifting towards SDL and GraphQL* classes as the internal mechanism and for advanced scenarios.
Most helpful comment
As stated in #130, the way types are exported is problematic:
graphql-js should export a
Typesobject which contains all the types without the "GraphQL" prefix:We can add the "Types" export without breaking 0.4 and remove prefixed types in 0.5.