mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-26 19:04:13 +08:00
Merge pull request #24121 from CommercialTribe/graphql-relay-connection-type
graphql-relay: make connection config relay spec compliant
This commit is contained in:
16
types/graphql-relay/index.d.ts
vendored
16
types/graphql-relay/index.d.ts
vendored
@@ -21,6 +21,9 @@ import {
|
||||
GraphQLOutputType,
|
||||
GraphQLFieldResolver,
|
||||
GraphQLTypeResolver,
|
||||
GraphQLUnionType,
|
||||
GraphQLEnumType,
|
||||
GraphQLScalarType,
|
||||
Thunk
|
||||
} from "graphql";
|
||||
|
||||
@@ -58,9 +61,20 @@ export const backwardConnectionArgs: GraphQLFieldConfigArgumentMap & {
|
||||
*/
|
||||
export const connectionArgs: GraphQLFieldConfigArgumentMap & ForwardConnectionArgs & BackwardConnectionArgs;
|
||||
|
||||
export type ConnectionConfigNodeTypeNullable =
|
||||
| GraphQLScalarType
|
||||
| GraphQLObjectType
|
||||
| GraphQLInterfaceType
|
||||
| GraphQLUnionType
|
||||
| GraphQLEnumType;
|
||||
|
||||
export type ConnectionConfigNodeType =
|
||||
| ConnectionConfigNodeTypeNullable
|
||||
| GraphQLNonNull<ConnectionConfigNodeTypeNullable>;
|
||||
|
||||
export interface ConnectionConfig {
|
||||
name?: string | null;
|
||||
nodeType: GraphQLObjectType;
|
||||
nodeType: ConnectionConfigNodeType;
|
||||
resolveNode?: GraphQLFieldResolver<any, any> | null;
|
||||
resolveCursor?: GraphQLFieldResolver<any, any> | null;
|
||||
edgeFields?: Thunk<GraphQLFieldConfigMap<any, any>> | null;
|
||||
|
||||
Reference in New Issue
Block a user