Merge pull request #23500 from ravishivt/23499_graphql-relay_add_nodes_field

[@types/graphql-relay] Fix #23499. Add nodes field to GraphQLNodeDefinitions
This commit is contained in:
Daniel Rosenwasser
2018-02-13 16:27:49 -08:00
committed by GitHub
2 changed files with 3 additions and 1 deletions

View File

@@ -122,7 +122,8 @@ const idFetcher = (id: string, context: number, info: GraphQLResolveInfo) => {
info.fieldName = "f";
};
const nodeDef = nodeDefinitions<number>(idFetcher, resolver);
const fieldConfig: GraphQLFieldConfig<any, any> = nodeDef.nodeField;
const nodeFieldConfig: GraphQLFieldConfig<any, any> = nodeDef.nodeField;
const nodesFieldConfig: GraphQLFieldConfig<any, any> = nodeDef.nodesField;
const interfaceType: GraphQLInterfaceType = nodeDef.nodeInterface;
// toGlobalId takes a type name and an ID specific to that type name, and returns a "global ID" that is unique among all types.
toGlobalId("t", "i").toLowerCase();

View File

@@ -245,6 +245,7 @@ export function mutationWithClientMutationId(
export interface GraphQLNodeDefinitions {
nodeInterface: GraphQLInterfaceType;
nodeField: GraphQLFieldConfig<any, any>;
nodesField: GraphQLFieldConfig<any, any>;
}
export type typeResolverFn = ((any: any) => GraphQLObjectType) |