@pothos/plugin-relay
Advanced tools
Comparing version 3.18.1 to 3.19.0
# Change Log | ||
## 3.19.0 | ||
### Minor Changes | ||
- 09572175: Add options for default payload and mutation type options | ||
## 3.18.1 | ||
@@ -4,0 +10,0 @@ |
@@ -51,2 +51,4 @@ import { GraphQLResolveInfo } from 'graphql'; | ||
}>>; | ||
defaultPayloadTypeOptions: Partial<PothosSchemaTypes.ObjectTypeOptions<Types, {}>>; | ||
defaultMutationInputTypeOptions: Partial<Omit<PothosSchemaTypes.InputObjectTypeOptions<Types, {}>, 'fields'>>; | ||
}>; | ||
@@ -53,0 +55,0 @@ export interface DefaultEdgesNullability { |
@@ -183,2 +183,3 @@ /* eslint-disable @typescript-eslint/no-unsafe-return */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ import SchemaBuilder, { createContextCache, getTypeBrand, InputObjectRef, ObjectRef, verifyRef } from '@pothos/core'; | ||
schemaBuilderProto.relayMutationField = function relayMutationField(fieldName, inputOptionsOrRef, { resolve, ...fieldOptions }, { name: payloadName = `${capitalize(fieldName)}Payload`, outputFields, interfaces, ...paylaodOptions }) { | ||
var ref; | ||
const { relayOptions: { clientMutationIdInputOptions = {}, clientMutationIdFieldOptions = {}, mutationInputArgOptions = {}, }, } = this.options; | ||
@@ -192,5 +193,7 @@ const includeClientMutationId = this.options.relayOptions.clientMutationId !== "omit"; | ||
else { | ||
var ref1; | ||
const { name: inputName = `${capitalize(fieldName)}Input`, argName: argNameFromOptions = "input", inputFields, ...inputOptions } = inputOptionsOrRef; | ||
argName = argNameFromOptions; | ||
inputRef = this.inputType(inputName, { | ||
...(ref1 = this.options.relayOptions) === null || ref1 === void 0 ? void 0 : ref1.defaultMutationInputTypeOptions, | ||
...inputOptions, | ||
@@ -209,2 +212,3 @@ fields: (t) => ({ | ||
const payloadRef = this.objectRef(payloadName).implement({ | ||
...(ref = this.options.relayOptions) === null || ref === void 0 ? void 0 : ref.defaultPayloadTypeOptions, | ||
...paylaodOptions, | ||
@@ -211,0 +215,0 @@ interfaces: interfaces, |
@@ -235,2 +235,3 @@ /* eslint-disable @typescript-eslint/no-unsafe-return */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ "use strict"; | ||
schemaBuilderProto.relayMutationField = function relayMutationField(fieldName, inputOptionsOrRef, { resolve , ...fieldOptions }, { name: payloadName = `${(0, _utils.capitalize)(fieldName)}Payload` , outputFields , interfaces , ...paylaodOptions }) { | ||
var ref; | ||
const { relayOptions: { clientMutationIdInputOptions ={} , clientMutationIdFieldOptions ={} , mutationInputArgOptions ={} , } , } = this.options; | ||
@@ -243,5 +244,7 @@ const includeClientMutationId = this.options.relayOptions.clientMutationId !== 'omit'; | ||
} else { | ||
var ref1; | ||
const { name: inputName = `${(0, _utils.capitalize)(fieldName)}Input` , argName: argNameFromOptions = 'input' , inputFields , ...inputOptions } = inputOptionsOrRef; | ||
argName = argNameFromOptions; | ||
inputRef = this.inputType(inputName, { | ||
...(ref1 = this.options.relayOptions) === null || ref1 === void 0 ? void 0 : ref1.defaultMutationInputTypeOptions, | ||
...inputOptions, | ||
@@ -260,2 +263,3 @@ fields: (t)=>({ | ||
const payloadRef = this.objectRef(payloadName).implement({ | ||
...(ref = this.options.relayOptions) === null || ref === void 0 ? void 0 : ref.defaultPayloadTypeOptions, | ||
...paylaodOptions, | ||
@@ -262,0 +266,0 @@ interfaces: interfaces, |
{ | ||
"name": "@pothos/plugin-relay", | ||
"version": "3.18.1", | ||
"version": "3.19.0", | ||
"description": "A Pothos plugin for adding relay style connections, nodes, and cursor based pagination to your GraphQL schema", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -309,2 +309,3 @@ /* eslint-disable @typescript-eslint/no-unsafe-return */ | ||
inputRef = this.inputType(inputName, { | ||
...this.options.relayOptions?.defaultMutationInputTypeOptions, | ||
...inputOptions, | ||
@@ -326,2 +327,3 @@ fields: (t) => ({ | ||
const payloadRef = this.objectRef<unknown>(payloadName).implement({ | ||
...this.options.relayOptions?.defaultPayloadTypeOptions, | ||
...paylaodOptions, | ||
@@ -328,0 +330,0 @@ interfaces: interfaces as never, |
@@ -187,2 +187,6 @@ import { GraphQLResolveInfo } from 'graphql'; | ||
>; | ||
defaultPayloadTypeOptions: Partial<PothosSchemaTypes.ObjectTypeOptions<Types, {}>>; | ||
defaultMutationInputTypeOptions: Partial< | ||
Omit<PothosSchemaTypes.InputObjectTypeOptions<Types, {}>, 'fields'> | ||
>; | ||
}>; | ||
@@ -189,0 +193,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
362305
4094