mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-22 11:57:33 +08:00
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:
@@ -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();
|
||||
|
||||
1
types/graphql-relay/index.d.ts
vendored
1
types/graphql-relay/index.d.ts
vendored
@@ -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) |
|
||||
|
||||
Reference in New Issue
Block a user