Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upcoming Release Changes #6283

Merged
merged 1 commit into from
Jun 21, 2024
Merged

Upcoming Release Changes #6283

merged 1 commit into from
Jun 21, 2024

Conversation

theguild-bot
Copy link
Collaborator

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to master, this PR will be updated.

Releases

@graphql-tools/[email protected]

Patch Changes

  • #6280
    7dcd0af
    Thanks @ardatan! - Since the executor is version agnostic, it should
    respect the schemas created with older versions.

    So if a type resolver returns a type instead of type name which is required since graphql@16,
    the executor should handle it correctly.

    See the following example:

    // Assume that the following code is executed with `graphql@15`
    import { execute } from '@graphql-tools/executor'
    
    const BarType = new GraphQLObjectType({
      name: 'Bar',
      fields: {
        bar: {
          type: GraphQLString,
          resolve: () => 'bar'
        }
      }
    })
    const BazType = new GraphQLObjectType({
      name: 'Baz',
      fields: {
        baz: {
          type: GraphQLString,
          resolve: () => 'baz'
        }
      }
    })
    const BarBazType = new GraphQLUnionType({
      name: 'BarBaz',
      types: [BarType, BazType],
      // This is the resolver that returns the type instead of type name
      resolveType(obj) {
        if ('bar' in obj) {
          return BarType
        }
        if ('baz' in obj) {
          return BazType
        }
      }
    })
    const QueryType = new GraphQLObjectType({
      name: 'Query',
      fields: {
        barBaz: {
          type: BarBazType,
          resolve: () => ({ bar: 'bar' })
        }
      }
    })
    const schema = new GraphQLSchema({
      query: QueryType
    })
    
    const result = await execute({
      schema,
      document: parse(/* GraphQL */ `
        query {
          barBaz {
            ... on Bar {
              bar
            }
            ... on Baz {
              baz
            }
          }
        }
      `)
    })
    
    expect(result).toEqual({
      data: {
        barBaz: {
          bar: 'bar'
        }
      }
    })

Copy link
Contributor

🚀 Snapshot Release (rc)

The latest changes of this PR are available as rc on npm (based on the declared changesets):

Package Version Info
@graphql-tools/executor 1.2.7-rc-20240621213320-f1fcdbeb227bd91ed1cbed9298e0b0c2b947b6aa npm ↗︎ unpkg ↗︎

Copy link
Contributor

✅ Benchmark Results

     ✓ no_errors
     ✓ expected_result

     checks.........................: 100.00% ✓ 332       ✗ 0  
     data_received..................: 39 MB   3.8 MB/s
     data_sent......................: 142 kB  14 kB/s
     http_req_blocked...............: avg=4.15µs   min=2.08µs   med=2.75µs   max=182.17µs p(90)=4.04µs   p(95)=4.65µs  
     http_req_connecting............: avg=730ns    min=0s       med=0s       max=121.21µs p(90)=0s       p(95)=0s      
     http_req_duration..............: avg=56.16ms  min=48ms     med=52.37ms  max=152.78ms p(90)=60.21ms  p(95)=89.24ms 
       { expected_response:true }...: avg=56.16ms  min=48ms     med=52.37ms  max=152.78ms p(90)=60.21ms  p(95)=89.24ms 
     http_req_failed................: 0.00%   ✓ 0         ✗ 166
     http_req_receiving.............: avg=132.07µs min=106.13µs med=126.25µs max=491.06µs p(90)=151.96µs p(95)=165.08µs
     http_req_sending...............: avg=25.74µs  min=19.1µs   med=24.71µs  max=63.5µs   p(90)=32.61µs  p(95)=35.78µs 
     http_req_tls_handshaking.......: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=56.01ms  min=47.82ms  med=52.22ms  max=152.22ms p(90)=60.06ms  p(95)=89.08ms 
     http_reqs......................: 166     16.517247/s
     iteration_duration.............: avg=60.52ms  min=52.01ms  med=57.14ms  max=158.18ms p(90)=66.33ms  p(95)=93.42ms 
     iterations.....................: 166     16.517247/s
     vus............................: 1       min=1       max=1
     vus_max........................: 1       min=1       max=1

Copy link
Contributor

💻 Website Preview

The latest changes are available as preview in: https://08b4af5c.graphql-tools.pages.dev

@ardatan ardatan merged commit 97b312a into master Jun 21, 2024
30 checks passed
@ardatan ardatan deleted the changeset-release/master branch June 21, 2024 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants