Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented May 24, 2023

This PR contains the following updates:

Package Change Age Confidence
@graphql-codegen/testing 2.0.2 -> 4.0.0 age confidence
@graphql-codegen/typescript (source) 3.0.4 -> 5.0.4 age confidence

Release Notes

dotansimha/graphql-code-generator (@​graphql-codegen/testing)

v4.0.0

Compare Source

v3.0.4

Compare Source

v3.0.3

Compare Source

v3.0.2

Compare Source

v3.0.1

Compare Source

v3.0.0

Compare Source

dotansimha/graphql-code-generator (@​graphql-codegen/typescript)

v5.0.4

Compare Source

Patch Changes

v5.0.3

Compare Source

Patch Changes

v5.0.2

Compare Source

Patch Changes

v5.0.1

Compare Source

Patch Changes

v5.0.0

Compare Source

Major Changes
Patch Changes

v4.1.6

Compare Source

Patch Changes

v4.1.5

Compare Source

Patch Changes

v4.1.4

Compare Source

Patch Changes

v4.1.3

Compare Source

Patch Changes

v4.1.2

Compare Source

Patch Changes

v4.1.1

Compare Source

Patch Changes

v4.1.0

Compare Source

Minor Changes
  • #​10077 3f4f546 Thanks @​eddeee888! - Extend config.avoidOptions to support query, mutation and subscription

    Previously, config.avoidOptions.resolvers was being used to make query, mutation and subscription fields non-optional.
    Now, config.avoidOptions.query, config.avoidOptions.mutation and config.avoidOptions.subscription can be used to target the respective types.

Patch Changes

v4.0.9

Compare Source

Patch Changes

v4.0.8

Compare Source

Patch Changes

v4.0.7

Compare Source

Patch Changes

v4.0.6

Compare Source

Patch Changes

v4.0.5

Compare Source

Patch Changes

v4.0.4

Compare Source

Patch Changes

v4.0.3

Compare Source

Patch Changes

v4.0.2

Compare Source

Patch Changes

v4.0.1

Compare Source

Patch Changes
  • #​9497 2276708d0 Thanks @​eddeee888! - Revert default ID scalar input type to string

    We changed the ID Scalar input type from string to string | number in the latest major version of typescript plugin. This causes issues for server plugins (e.g. typescript-resolvers) that depends on typescript plugin. This is because the scalar type needs to be manually inverted on setup which is confusing.

  • Updated dependencies [2276708d0]:

v4.0.0

Compare Source

Major Changes
  • #​9375 ba84a3a27 Thanks @​eddeee888! - Implement Scalars with input/output types

    In GraphQL, Scalar types can be different for client and server. For example, given the native GraphQL ID:

    • A client may send string or number in the input
    • A client receives string in its selection set (i.e output)
    • A server receives string in the resolver (GraphQL parses string or number received from the client to string)
    • A server may return string or number (GraphQL serializes the value to string before sending it to the client )

    Currently, we represent every Scalar with only one type. This is what codegen generates as base type:

    export type Scalars = {
      ID: string
    }

    Then, this is used in both input and output type e.g.

    export type Book = {
      __typename?: 'Book'
      id: Scalars['ID'] // Output's ID can be `string` 👍
    }
    
    export type QueryBookArgs = {
      id: Scalars['ID'] // Input's ID can be `string` or `number`. However, the type is only `string` here 👎
    }

    This PR extends each Scalar to have input and output:

    export type Scalars = {
      ID: {
        input: string | number
        output: string
      }
    }

    Then, each input/output GraphQL type can correctly refer to the correct input/output scalar type:

    export type Book = {
      __typename?: 'Book'
      id: Scalars['ID']['output'] // Output's ID can be `string` 👍
    }
    
    export type QueryBookArgs = {
      id: Scalars['ID']['input'] // Input's ID can be `string` or `number` 👍
    }

    Note that for typescript-resolvers, the type of ID needs to be inverted. However, the referenced types in GraphQL input/output types should still work correctly:

    export type Scalars = {
      ID: {
        input: string;
        output: string | number;
      }
    }
    
    export type Book = {
      __typename?: "Book";
      id: Scalars["ID"]['output']; // Resolvers can return `string` or `number` in ID fields 👍
    };
    
    export type QueryBookArgs = {
      id: Scalars["ID"]['input']; // Resolvers receive `string` in ID fields 👍
    };
    
    export type ResolversTypes = {
      ID: ID: ResolverTypeWrapper<Scalars['ID']['output']>; // Resolvers can return `string` or `number` in ID fields 👍
    }
    
    export type ResolversParentTypes = {
      ID: Scalars['ID']['output']; // Resolvers receive `string` or `number` from parents 👍
    };

    Config changes:

    1. Scalars option can now take input/output types:
    config: {
      scalars: {
        ID: {
          input: 'string',
          output: 'string | number'
        }
      }
    }
    1. If a string is given (instead of an object with input/output fields), it will be used as both input and output types:
    config: {
      scalars: {
        ID: 'string' // This means `string` will be used for both ID's input and output types
      }
    }
    1. BREAKING CHANGE: External module Scalar types need to be an object with input/output fields
    config: {
      scalars: {
        ID: './path/to/scalar-module'
      }
    }

    If correctly, wired up, the following will be generated:

    // Previously, imported `ID` type can be a primitive type, now it must be an object with input/output fields
    import { ID } from './path/to/scalar-module'
    
    export type Scalars = {
      ID: { input: ID['input']; output: ID['output'] }
    }

    BREAKING CHANGE: This changes Scalar types which could be referenced in other plugins. If you are a plugin maintainer and reference Scalar, please update your plugin to use the correct input/output types.

  • bb66c2a31 Thanks @​n1ru4l! - Require Node.js >= 16. Drop support for Node.js 14

Minor Changes
  • #​9196 3848a2b73 Thanks @​beerose! - Add @defer directive support

    When a query includes a deferred fragment field, the server will return a partial response with the non-deferred fields first, followed by the remaining fields once they have been resolved.

    Once start using the @defer directive in your queries, the generated code will automatically include support for the directive.

    // src/index.tsx
    import { graphql } from './gql'
    const OrdersFragment = graphql(`
      fragment OrdersFragment on User {
        orders {
          id
          total
        }
      }
    `)
    const GetUserQuery = graphql(`
      query GetUser($id: ID!) {
        user(id: $id) {
          id
          name
          ...OrdersFragment @&#8203;defer
        }
      }
    `)

    The generated type for GetUserQuery will have information that the fragment is incremental, meaning it may not be available right away.

    // gql/graphql.ts
    export type GetUserQuery = { __typename?: 'Query'; id: string; name: string } & ({
      __typename?: 'Query'
    } & {
      ' $fragmentRefs'?: { OrdersFragment: Incremental<OrdersFragment> }
    })

    Apart from generating code that includes support for the @defer directive, the Codegen also exports a utility function called isFragmentReady. You can use it to conditionally render components based on whether the data for a deferred
    fragment is available:

    const OrdersList = (props: { data: FragmentType<typeof OrdersFragment> }) => {
      const data = useFragment(OrdersFragment, props.data);
      return (
        // render orders list
      )
    };
    
    function App() {
      const { data } = useQuery(GetUserQuery);
      return (
        {data && (
          <>
            {isFragmentReady(GetUserQuery, OrdersFragment, data)
    					&& <OrdersList data={data} />}
          </>
        )}
      );
    }
    export default App;
  • #​9304 e1dc75f3c Thanks @​esfomeado! - Added support for disabling suffixes on Enums.

Patch Changes

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot added the dependencies Pull requests that update a dependency file label May 24, 2023
@changeset-bot
Copy link

changeset-bot bot commented May 24, 2023

⚠️ No Changeset found

Latest commit: 77564a7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@renovate renovate bot force-pushed the renovate/major-graphql-codegen branch from 448523b to 60b8bd5 Compare June 19, 2023 08:27
@renovate renovate bot force-pushed the renovate/major-graphql-codegen branch from 60b8bd5 to 13efeb9 Compare February 6, 2024 16:48
@renovate renovate bot force-pushed the renovate/major-graphql-codegen branch 2 times, most recently from 93b9be3 to c0d25d8 Compare February 22, 2024 23:04
@renovate renovate bot force-pushed the renovate/major-graphql-codegen branch from c0d25d8 to 2b2dcd7 Compare May 17, 2024 18:27
@renovate renovate bot force-pushed the renovate/major-graphql-codegen branch 2 times, most recently from 8d856d7 to 067a9d6 Compare July 2, 2024 09:04
@renovate renovate bot force-pushed the renovate/major-graphql-codegen branch 2 times, most recently from 7f8f13b to 6e1e7c5 Compare August 12, 2024 03:24
@renovate renovate bot force-pushed the renovate/major-graphql-codegen branch from 6e1e7c5 to 27a1e28 Compare October 7, 2024 15:11
@renovate renovate bot force-pushed the renovate/major-graphql-codegen branch from 27a1e28 to ad25880 Compare October 28, 2024 14:07
@renovate renovate bot force-pushed the renovate/major-graphql-codegen branch from ad25880 to 788bd83 Compare November 22, 2024 21:50
@renovate renovate bot force-pushed the renovate/major-graphql-codegen branch from 788bd83 to 17e3edb Compare January 28, 2025 13:06
@renovate renovate bot force-pushed the renovate/major-graphql-codegen branch 3 times, most recently from dcf588e to 5879b0b Compare February 23, 2025 22:40
@renovate renovate bot force-pushed the renovate/major-graphql-codegen branch from 5879b0b to 674adea Compare March 17, 2025 07:38
@renovate renovate bot force-pushed the renovate/major-graphql-codegen branch 2 times, most recently from 12b0638 to 478f44b Compare March 31, 2025 07:03
@renovate renovate bot force-pushed the renovate/major-graphql-codegen branch from 478f44b to d61c614 Compare May 5, 2025 06:05
@renovate renovate bot force-pushed the renovate/major-graphql-codegen branch from d61c614 to c2cb853 Compare May 12, 2025 07:33
@renovate renovate bot force-pushed the renovate/major-graphql-codegen branch from c2cb853 to 7f05b53 Compare June 9, 2025 05:37
@renovate renovate bot force-pushed the renovate/major-graphql-codegen branch 2 times, most recently from 36e060b to 1343d48 Compare July 7, 2025 04:43
@renovate renovate bot force-pushed the renovate/major-graphql-codegen branch from 1343d48 to 7c4e951 Compare July 14, 2025 05:04
@renovate renovate bot force-pushed the renovate/major-graphql-codegen branch from 7c4e951 to d51fb73 Compare July 28, 2025 08:40
@renovate renovate bot force-pushed the renovate/major-graphql-codegen branch 2 times, most recently from fea68b6 to c7afb30 Compare August 18, 2025 06:04
@renovate renovate bot force-pushed the renovate/major-graphql-codegen branch from c7afb30 to 97ae9c6 Compare August 31, 2025 11:11
@renovate renovate bot force-pushed the renovate/major-graphql-codegen branch 2 times, most recently from 21e04fe to 911c4f1 Compare September 8, 2025 05:40
@renovate renovate bot force-pushed the renovate/major-graphql-codegen branch 2 times, most recently from cfcc61d to fbac1a5 Compare September 29, 2025 17:34
@renovate renovate bot force-pushed the renovate/major-graphql-codegen branch from fbac1a5 to ff8c369 Compare October 5, 2025 17:56
@renovate renovate bot force-pushed the renovate/major-graphql-codegen branch 2 times, most recently from dcc9262 to 1867af5 Compare October 27, 2025 04:46
@renovate renovate bot force-pushed the renovate/major-graphql-codegen branch 2 times, most recently from b5faf35 to fb8848d Compare November 12, 2025 22:13
@renovate renovate bot force-pushed the renovate/major-graphql-codegen branch from fb8848d to 77564a7 Compare November 13, 2025 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant