private String getClientMutationIdName() { return graphQLSchemaHolder.getGraphQLSchemaConfig().getClientMutationIdName(); }
private void injectClientMutationIdIfRequired(Map<String, Object> inputMap, Map<String, Object> outputMap) { if (getGraphQLSchemaConfig().isInjectClientMutationId()) { String clientMutationId = (String) inputMap.get(getGraphQLSchemaConfig().getClientMutationIdName()); outputMap.put(getGraphQLSchemaConfig().getClientMutationIdName(), clientMutationId); } }
.name(inputObjectName + getGraphQLSchemaConfig().getInputObjectNamePrefix()) .field(newInputObjectField() .name(getGraphQLSchemaConfig().getClientMutationIdName()) .type(clientMutationIdType) .build())
public GraphQLObjectType createGraphQLOutputObjectType(DfsContext dfsContext, String mutationName, ResolvableTypeAccessor resolvableTypeAccessor) { Class<?> cls = resolvableTypeAccessor.resolve(); GraphQLType graphQLObjectType = objectTypeResolverMap.get(cls); if (graphQLObjectType == null) graphQLObjectType = createGraphQLFieldType(dfsContext, resolvableTypeAccessor, true); GraphQLOutputType clientMutationIdType = getGraphQLSchemaConfig().isAllowEmptyClientMutationId() ? GraphQLString : new GraphQLNonNull(GraphQLString); addToMutationReturnTypeResolverMap(dfsContext, mutationName, cls, (GraphQLOutputType) graphQLObjectType); GraphQLFieldDefinition graphQLFieldDefinition = newFieldDefinition() .name(resolvableTypeAccessor.getGraphQLOutName()) .deprecate(resolvableTypeAccessor.getGraphQLDeprecationReason()) .description(resolvableTypeAccessor.getDescription()) .type((GraphQLOutputType) graphQLObjectType) .build(); addToFieldDefinitionResolverMap(dfsContext, graphQLFieldDefinition, resolvableTypeAccessor.getGraphQLComplexitySpelExpression()); return newObject() .name(resolvableTypeAccessor.getName() + getGraphQLSchemaConfig().getOutputObjectNamePrefix()) .field(newFieldDefinition() .name(getGraphQLSchemaConfig().getClientMutationIdName()) .type(clientMutationIdType) .build()) .field(graphQLFieldDefinition) .build(); }