Packages

@graphql-tools/wrap

11.2.6 · 12 Nov 2026MIT15.3M / weekRepositorynpmAtom feed

Your version

10.0.28

20 Jan 2025Where it was published

10.1.4 is the newest release of 10.x.

In short

1 fixed1 internal

Release note

The section about @graphql-tools/wrap of a note shared by several packages.

Patch Changes

  • RenameObjectFieldArguments should transform the passed args in delegationContext.

    When a subschema's a root field argument is renamed, the passed arguments should be also transformed;

    type Query {
      # This is the original field
      book(book_id: ID): [Book]
    }
    
    type Book {
      id: ID
      title: String
    }

    When the subschema above is transformed to;

    type Query {
      # This is the transformed field
      book(bookId: ID): [Book]
    }
    
    type Book {
      id: ID
      title: String
    }

    The following call should be transformed;

    delegateToSchema({
      schema: {
        schema,
        transforms: [
          new RenameObjectFieldArguments((typeName, fieldName, argName) => {
            if (
              typeName === 'Query' &&
              fieldName === 'book' &&
              argName === 'book_id'
            ) {
              return 'bookId';
            }
            return argName;
          }),
        ],
      },
      operation: 'query',
      fieldName: 'book',
      args: {
        bookId: '1',
      },
    });

    To this query;

    {
        book(book_id: "1") {
            # ...
        }
    }

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.