mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
Merge pull request #24535 from deflagrator/graphql-relay
[graphql-relay] Cannot assign to 'fieldName', it is a readonly property.
This commit is contained in:
@@ -44,7 +44,7 @@ backwardConnectionArgs.before = "b";
|
||||
backwardConnectionArgs.last = 10;
|
||||
// connectionDefinitions returns a connectionType and its associated edgeType, given a node type.
|
||||
const resolve: GraphQLFieldResolver<any, any> = (source, args, context, info) => {
|
||||
info.fieldName = "f";
|
||||
context.flag = "f";
|
||||
};
|
||||
const fields: GraphQLFieldConfigMap<any, any> = {};
|
||||
let t: GraphQLObjectType;
|
||||
@@ -118,10 +118,10 @@ const resolver: GraphQLTypeResolver<any, any> = () => {
|
||||
fields: {},
|
||||
});
|
||||
};
|
||||
const idFetcher = (id: string, context: number, info: GraphQLResolveInfo) => {
|
||||
info.fieldName = "f";
|
||||
const idFetcher = (id: string, context: any, info: GraphQLResolveInfo) => {
|
||||
context.flag = "f";
|
||||
};
|
||||
const nodeDef = nodeDefinitions<number>(idFetcher, resolver);
|
||||
const nodeDef = nodeDefinitions<any>(idFetcher, resolver);
|
||||
const nodeFieldConfig: GraphQLFieldConfig<any, any> = nodeDef.nodeField;
|
||||
const nodesFieldConfig: GraphQLFieldConfig<any, any> = nodeDef.nodesField;
|
||||
const interfaceType: GraphQLInterfaceType = nodeDef.nodeInterface;
|
||||
@@ -183,10 +183,10 @@ mutationWithClientMutationId({
|
||||
inputFields: gifcm,
|
||||
mutateAndGetPayload: (
|
||||
object: any,
|
||||
ctx: any,
|
||||
context: any,
|
||||
info: GraphQLResolveInfo) => {
|
||||
return new Promise<string>((resolve) => {
|
||||
resolve(info.fieldName);
|
||||
resolve(context.flag);
|
||||
});
|
||||
},
|
||||
outputFields: gfcm,
|
||||
|
||||
Reference in New Issue
Block a user