Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pothos/plugin-relay

Package Overview
Dependencies
Maintainers
1
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pothos/plugin-relay - npm Package Compare versions

Comparing version 3.18.1 to 3.19.0

6

CHANGELOG.md
# Change Log
## 3.19.0
### Minor Changes
- 09572175: Add options for default payload and mutation type options
## 3.18.1

@@ -4,0 +10,0 @@

2

dts/types.d.ts

@@ -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,

2

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc