diff --git a/.changeset/@graphql-codegen_typescript-graphql-request-709-dependencies.md b/.changeset/@graphql-codegen_typescript-graphql-request-709-dependencies.md new file mode 100644 index 000000000..5168dc4f7 --- /dev/null +++ b/.changeset/@graphql-codegen_typescript-graphql-request-709-dependencies.md @@ -0,0 +1,5 @@ +--- +"@graphql-codegen/typescript-graphql-request": patch +--- +dependencies updates: + - Updated dependency [`graphql-request@^6.0.0 || ^7.0.0` ↗︎](https://www.npmjs.com/package/graphql-request/v/6.0.0) (from `^6.0.0`, in `peerDependencies`) diff --git a/.changeset/@graphql-codegen_typescript-rtk-query-709-dependencies.md b/.changeset/@graphql-codegen_typescript-rtk-query-709-dependencies.md new file mode 100644 index 000000000..10d8b2d11 --- /dev/null +++ b/.changeset/@graphql-codegen_typescript-rtk-query-709-dependencies.md @@ -0,0 +1,5 @@ +--- +"@graphql-codegen/typescript-rtk-query": patch +--- +dependencies updates: + - Updated dependency [`graphql-request@^3.4.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0` ↗︎](https://www.npmjs.com/package/graphql-request/v/3.4.0) (from `^3.4.0 || ^4.0.0 || ^5.0.0 || ^6.0.0`, in `peerDependencies`) diff --git a/dev-test/githunt/__generated__/comment-added.subscription.stencil-component.tsx b/dev-test/githunt/__generated__/comment-added.subscription.stencil-component.tsx index 0b4ee704f..65ffd459b 100644 --- a/dev-test/githunt/__generated__/comment-added.subscription.stencil-component.tsx +++ b/dev-test/githunt/__generated__/comment-added.subscription.stencil-component.tsx @@ -1,4 +1,4 @@ -import gql from 'graphql-tag'; +import { gql } from 'graphql-tag'; import 'stencil-apollo'; import { Component, h, Prop } from '@stencil/core'; diff --git a/dev-test/githunt/__generated__/comment.query.stencil-component.tsx b/dev-test/githunt/__generated__/comment.query.stencil-component.tsx index 7101e0ade..d3bea2dc6 100644 --- a/dev-test/githunt/__generated__/comment.query.stencil-component.tsx +++ b/dev-test/githunt/__generated__/comment.query.stencil-component.tsx @@ -1,4 +1,4 @@ -import gql from 'graphql-tag'; +import { gql } from 'graphql-tag'; import { CommentsPageCommentFragmentDoc } from './comments-page-comment.fragment.stencil-component.js'; import 'stencil-apollo'; import { Component, h, Prop } from '@stencil/core'; diff --git a/dev-test/githunt/__generated__/comments-page-comment.fragment.stencil-component.tsx b/dev-test/githunt/__generated__/comments-page-comment.fragment.stencil-component.tsx index 506a01c08..418d3361d 100644 --- a/dev-test/githunt/__generated__/comments-page-comment.fragment.stencil-component.tsx +++ b/dev-test/githunt/__generated__/comments-page-comment.fragment.stencil-component.tsx @@ -1,4 +1,4 @@ -import gql from 'graphql-tag'; +import { gql } from 'graphql-tag'; declare global { export type CommentsPageCommentFragment = { diff --git a/dev-test/githunt/__generated__/current-user.query.stencil-component.tsx b/dev-test/githunt/__generated__/current-user.query.stencil-component.tsx index c17d3aced..3e72c367a 100644 --- a/dev-test/githunt/__generated__/current-user.query.stencil-component.tsx +++ b/dev-test/githunt/__generated__/current-user.query.stencil-component.tsx @@ -1,4 +1,4 @@ -import gql from 'graphql-tag'; +import { gql } from 'graphql-tag'; import 'stencil-apollo'; import { Component, h, Prop } from '@stencil/core'; diff --git a/dev-test/githunt/__generated__/feed-entry.fragment.stencil-component.tsx b/dev-test/githunt/__generated__/feed-entry.fragment.stencil-component.tsx index 6d4a457ba..08b026852 100644 --- a/dev-test/githunt/__generated__/feed-entry.fragment.stencil-component.tsx +++ b/dev-test/githunt/__generated__/feed-entry.fragment.stencil-component.tsx @@ -1,4 +1,4 @@ -import gql from 'graphql-tag'; +import { gql } from 'graphql-tag'; import { RepoInfoFragmentDoc } from './repo-info.fragment.stencil-component.js'; import { VoteButtonsFragmentDoc } from './vote-buttons.fragment.stencil-component.js'; diff --git a/dev-test/githunt/__generated__/feed.query.stencil-component.tsx b/dev-test/githunt/__generated__/feed.query.stencil-component.tsx index dff7e0525..0f6e752c7 100644 --- a/dev-test/githunt/__generated__/feed.query.stencil-component.tsx +++ b/dev-test/githunt/__generated__/feed.query.stencil-component.tsx @@ -1,4 +1,4 @@ -import gql from 'graphql-tag'; +import { gql } from 'graphql-tag'; import { FeedEntryFragmentDoc } from './feed-entry.fragment.stencil-component.js'; import 'stencil-apollo'; import { Component, h, Prop } from '@stencil/core'; diff --git a/dev-test/githunt/__generated__/new-entry.mutation.stencil-component.tsx b/dev-test/githunt/__generated__/new-entry.mutation.stencil-component.tsx index fd6bee158..d763b4ac7 100644 --- a/dev-test/githunt/__generated__/new-entry.mutation.stencil-component.tsx +++ b/dev-test/githunt/__generated__/new-entry.mutation.stencil-component.tsx @@ -1,4 +1,4 @@ -import gql from 'graphql-tag'; +import { gql } from 'graphql-tag'; import 'stencil-apollo'; import { Component, h, Prop } from '@stencil/core'; diff --git a/dev-test/githunt/__generated__/repo-info.fragment.stencil-component.tsx b/dev-test/githunt/__generated__/repo-info.fragment.stencil-component.tsx index 7b7c03291..4edbfba28 100644 --- a/dev-test/githunt/__generated__/repo-info.fragment.stencil-component.tsx +++ b/dev-test/githunt/__generated__/repo-info.fragment.stencil-component.tsx @@ -1,4 +1,4 @@ -import gql from 'graphql-tag'; +import { gql } from 'graphql-tag'; declare global { export type RepoInfoFragment = { diff --git a/dev-test/githunt/__generated__/submit-comment.mutation.stencil-component.tsx b/dev-test/githunt/__generated__/submit-comment.mutation.stencil-component.tsx index c99d60838..e668bd4d3 100644 --- a/dev-test/githunt/__generated__/submit-comment.mutation.stencil-component.tsx +++ b/dev-test/githunt/__generated__/submit-comment.mutation.stencil-component.tsx @@ -1,4 +1,4 @@ -import gql from 'graphql-tag'; +import { gql } from 'graphql-tag'; import { CommentsPageCommentFragmentDoc } from './comments-page-comment.fragment.stencil-component.js'; import 'stencil-apollo'; import { Component, h, Prop } from '@stencil/core'; diff --git a/dev-test/githunt/__generated__/vote-buttons.fragment.stencil-component.tsx b/dev-test/githunt/__generated__/vote-buttons.fragment.stencil-component.tsx index 5bcbc3651..7f4374c57 100644 --- a/dev-test/githunt/__generated__/vote-buttons.fragment.stencil-component.tsx +++ b/dev-test/githunt/__generated__/vote-buttons.fragment.stencil-component.tsx @@ -1,4 +1,4 @@ -import gql from 'graphql-tag'; +import { gql } from 'graphql-tag'; declare global { export type VoteButtonsFragment = { diff --git a/dev-test/githunt/__generated__/vote.mutation.stencil-component.tsx b/dev-test/githunt/__generated__/vote.mutation.stencil-component.tsx index fdc9755d6..afae9a7f3 100644 --- a/dev-test/githunt/__generated__/vote.mutation.stencil-component.tsx +++ b/dev-test/githunt/__generated__/vote.mutation.stencil-component.tsx @@ -1,4 +1,4 @@ -import gql from 'graphql-tag'; +import { gql } from 'graphql-tag'; import 'stencil-apollo'; import { Component, h, Prop } from '@stencil/core'; diff --git a/dev-test/githunt/jit-sdk.ts b/dev-test/githunt/jit-sdk.ts index 6a1f3b6bc..aaa708b21 100644 --- a/dev-test/githunt/jit-sdk.ts +++ b/dev-test/githunt/jit-sdk.ts @@ -1,6 +1,6 @@ import { ExecutionResult, GraphQLSchema } from 'graphql'; import { compileQuery, CompilerOptions, isCompiledQuery } from 'graphql-jit'; -import gql from 'graphql-tag'; +import { gql } from 'graphql-tag'; import { AggregateError, isAsyncIterable, mapAsyncIterator } from '@graphql-tools/utils'; export type Maybe = T | null; diff --git a/dev-test/githunt/types.reactApollo.v2.tsx b/dev-test/githunt/types.reactApollo.v2.tsx index 977261f5f..5c1a81b63 100644 --- a/dev-test/githunt/types.reactApollo.v2.tsx +++ b/dev-test/githunt/types.reactApollo.v2.tsx @@ -1,4 +1,4 @@ -import gql from 'graphql-tag'; +import { gql } from 'graphql-tag'; import * as ApolloReactCommon from '@apollo/react-common'; import * as ApolloReactHooks from '@apollo/react-hooks'; diff --git a/dev-test/githunt/types.stencilApollo.tsx b/dev-test/githunt/types.stencilApollo.tsx index 2a9954ddb..c45e92f2b 100644 --- a/dev-test/githunt/types.stencilApollo.tsx +++ b/dev-test/githunt/types.stencilApollo.tsx @@ -1,4 +1,4 @@ -import gql from 'graphql-tag'; +import { gql } from 'graphql-tag'; import * as StencilApollo from 'stencil-apollo'; import { h } from '@stencil/core'; diff --git a/dev-test/githunt/types.urql.tsx b/dev-test/githunt/types.urql.tsx index 18b76205b..766693b54 100644 --- a/dev-test/githunt/types.urql.tsx +++ b/dev-test/githunt/types.urql.tsx @@ -1,5 +1,5 @@ import { IntrospectionQuery } from 'graphql'; -import gql from 'graphql-tag'; +import { gql } from 'graphql-tag'; import * as Urql from 'urql'; import { cacheExchange, diff --git a/dev-test/githunt/types.vueApollo.ts b/dev-test/githunt/types.vueApollo.ts index 57dcaa5b7..8ebeada6e 100644 --- a/dev-test/githunt/types.vueApollo.ts +++ b/dev-test/githunt/types.vueApollo.ts @@ -1,4 +1,4 @@ -import gql from 'graphql-tag'; +import { gql } from 'graphql-tag'; import * as VueApolloComposable from '@vue/apollo-composable'; import * as VueCompositionApi from '@vue/composition-api'; diff --git a/dev-test/githunt/types.vueApolloSmartOps.ts b/dev-test/githunt/types.vueApolloSmartOps.ts index f79e2293c..8f14b58cc 100644 --- a/dev-test/githunt/types.vueApolloSmartOps.ts +++ b/dev-test/githunt/types.vueApolloSmartOps.ts @@ -1,5 +1,5 @@ import { ApolloError } from 'apollo-client'; -import gql from 'graphql-tag'; +import { gql } from 'graphql-tag'; import { createMutationFunction, createSmartQueryOptionsFunction, diff --git a/dev-test/test-message/documents.ts b/dev-test/test-message/documents.ts index 6cded6f0a..5179a8610 100644 --- a/dev-test/test-message/documents.ts +++ b/dev-test/test-message/documents.ts @@ -1,4 +1,4 @@ -import gql from 'graphql-tag'; +import { gql } from 'graphql-tag'; // tslint:disable-next-line:variable-name export const GetMessages = gql` diff --git a/packages/plugins/c-sharp/c-sharp-operations/src/index.ts b/packages/plugins/c-sharp/c-sharp-operations/src/index.ts index 93f267c68..bfe33af53 100644 --- a/packages/plugins/c-sharp/c-sharp-operations/src/index.ts +++ b/packages/plugins/c-sharp/c-sharp-operations/src/index.ts @@ -1,6 +1,6 @@ import { extname } from 'path'; import { concatAST, FragmentDefinitionNode, GraphQLSchema, Kind } from 'graphql'; -import gql from 'graphql-tag'; +import { gql } from 'graphql-tag'; import { getCachedDocumentNodeFromSchema, oldVisit, diff --git a/packages/plugins/c-sharp/c-sharp/test/c-sharp.spec.ts b/packages/plugins/c-sharp/c-sharp/test/c-sharp.spec.ts index 1aeb2132c..8290088ac 100644 --- a/packages/plugins/c-sharp/c-sharp/test/c-sharp.spec.ts +++ b/packages/plugins/c-sharp/c-sharp/test/c-sharp.spec.ts @@ -1,10 +1,11 @@ import { buildSchema } from 'graphql'; -import each from 'jest-each'; import '@graphql-codegen/testing'; import { CSharpResolversPluginRawConfig } from '../src/config.js'; import { plugin } from '../src/index.js'; import { getJsonAttributeSourceConfiguration } from '../src/json-attributes.js'; +const each = require('jest-each').default; + describe('C#', () => { describe('Using directives', () => { it('Should include dotnet using directives', async () => { diff --git a/packages/plugins/flow/resolvers/src/index.ts b/packages/plugins/flow/resolvers/src/index.ts index 79e4b32be..012bd6921 100644 --- a/packages/plugins/flow/resolvers/src/index.ts +++ b/packages/plugins/flow/resolvers/src/index.ts @@ -6,7 +6,7 @@ import { PluginFunction, Types, } from '@graphql-codegen/plugin-helpers'; -import { FlowResolversPluginConfig } from './config'; +import { FlowResolversPluginConfig } from './config.js'; import { FlowResolversVisitor } from './visitor.js'; export const plugin: PluginFunction = ( diff --git a/packages/plugins/typescript/graphql-request/package.json b/packages/plugins/typescript/graphql-request/package.json index a3a50edd8..92383d80d 100644 --- a/packages/plugins/typescript/graphql-request/package.json +++ b/packages/plugins/typescript/graphql-request/package.json @@ -38,7 +38,7 @@ }, "peerDependencies": { "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0", - "graphql-request": "^6.0.0", + "graphql-request": "^6.0.0 || ^7.0.0", "graphql-tag": "^2.0.0" }, "dependencies": { @@ -50,7 +50,7 @@ "devDependencies": { "@graphql-codegen/testing": "1.18.0", "@graphql-tools/schema": "10.0.7", - "graphql-request": "6.0.0" + "graphql-request": "6.1.0" }, "publishConfig": { "directory": "dist", diff --git a/packages/plugins/typescript/graphql-request/tests/integration.spec.ts b/packages/plugins/typescript/graphql-request/tests/integration.spec.ts index 8f9d36b1e..97eb8bf22 100644 --- a/packages/plugins/typescript/graphql-request/tests/integration.spec.ts +++ b/packages/plugins/typescript/graphql-request/tests/integration.spec.ts @@ -64,7 +64,7 @@ describe('GraphQL Request Integration', () => { host: 'http://localhost:4000', path: '/graphql', }); - const { runExampleQuery } = require('./test-files/run-example-query'); + const { runExampleQuery } = await import('./test-files/run-example-query.js'); const queryResult = await runExampleQuery(2, 3); expect(queryResult?.add).toBe(5); mockServer.done(); diff --git a/packages/plugins/typescript/graphql-request/tests/test-files/run-example-query.ts b/packages/plugins/typescript/graphql-request/tests/test-files/run-example-query.ts index 7582fcf53..06f9a134e 100644 --- a/packages/plugins/typescript/graphql-request/tests/test-files/run-example-query.ts +++ b/packages/plugins/typescript/graphql-request/tests/test-files/run-example-query.ts @@ -1,7 +1,7 @@ import { GraphQLClient } from 'graphql-request'; import { getSdk } from './graphql-request-sdk.js'; -export function runExampleQuery(x: number, y: number) { +export async function runExampleQuery(x: number, y: number) { const client = new GraphQLClient('http://localhost:4000/graphql'); const sdk = getSdk(client); return sdk.Add({ x, y }); diff --git a/packages/plugins/typescript/mongodb/src/index.ts b/packages/plugins/typescript/mongodb/src/index.ts index f09aa2dba..ddd5eb08c 100644 --- a/packages/plugins/typescript/mongodb/src/index.ts +++ b/packages/plugins/typescript/mongodb/src/index.ts @@ -1,6 +1,6 @@ import { extname } from 'path'; import { GraphQLSchema } from 'graphql'; -import gql from 'graphql-tag'; +import { gql } from 'graphql-tag'; import { getCachedDocumentNodeFromSchema, oldVisit, diff --git a/packages/plugins/typescript/nest/tests/nest.spec.ts b/packages/plugins/typescript/nest/tests/nest.spec.ts index 9568214e3..cf55ffff0 100644 --- a/packages/plugins/typescript/nest/tests/nest.spec.ts +++ b/packages/plugins/typescript/nest/tests/nest.spec.ts @@ -1,7 +1,7 @@ import { buildSchema } from 'graphql'; import { Types } from '@graphql-codegen/plugin-helpers'; import '@graphql-codegen/testing'; -import { plugin } from '../src/index'; +import { plugin } from '../src/index.js'; describe('nest', () => { it('should expose Maybe', async () => { diff --git a/packages/plugins/typescript/nhost/src/index.ts b/packages/plugins/typescript/nhost/src/index.ts index f9a4fc2ab..0270ad97f 100644 --- a/packages/plugins/typescript/nhost/src/index.ts +++ b/packages/plugins/typescript/nhost/src/index.ts @@ -1,7 +1,7 @@ import { PluginFunction, Types } from '@graphql-codegen/plugin-helpers'; import { plugin as typescriptPlugin, TypeScriptPluginConfig } from '@graphql-codegen/typescript'; import { getIntrospectedSchema, minifyIntrospectionQuery } from '@urql/introspection'; -import { NhostPluginConfig } from './config'; +import { NhostPluginConfig } from './config.js'; type UnwrapPromise = T extends Promise ? U : T; diff --git a/packages/plugins/typescript/react-apollo/tests/react-apollo.spec.ts b/packages/plugins/typescript/react-apollo/tests/react-apollo.spec.ts index 3e1f76897..76de4434c 100644 --- a/packages/plugins/typescript/react-apollo/tests/react-apollo.spec.ts +++ b/packages/plugins/typescript/react-apollo/tests/react-apollo.spec.ts @@ -1,5 +1,5 @@ import { buildASTSchema, buildClientSchema, buildSchema, GraphQLSchema, parse } from 'graphql'; -import gql from 'graphql-tag'; +import { gql } from 'graphql-tag'; import { extract } from 'jest-docblock'; import { mergeOutputs, Types } from '@graphql-codegen/plugin-helpers'; import { validateTs } from '@graphql-codegen/testing'; diff --git a/packages/plugins/typescript/react-query/tests/react-query.spec.ts b/packages/plugins/typescript/react-query/tests/react-query.spec.ts index 1346c24ac..084bb0554 100644 --- a/packages/plugins/typescript/react-query/tests/react-query.spec.ts +++ b/packages/plugins/typescript/react-query/tests/react-query.spec.ts @@ -3,7 +3,7 @@ import { mergeOutputs, Types } from '@graphql-codegen/plugin-helpers'; import { validateTs } from '@graphql-codegen/testing'; import { plugin as tsPlugin } from '@graphql-codegen/typescript'; import { plugin as tsDocumentsPlugin } from '@graphql-codegen/typescript-operations'; -import type { ReactQueryRawPluginConfig } from '../src/config'; +import type { ReactQueryRawPluginConfig } from '../src/config.js'; import { plugin } from '../src/index.js'; const validateTypeScript = async ( diff --git a/packages/plugins/typescript/rtk-query/package.json b/packages/plugins/typescript/rtk-query/package.json index c0cf29e79..64e3f2732 100644 --- a/packages/plugins/typescript/rtk-query/package.json +++ b/packages/plugins/typescript/rtk-query/package.json @@ -39,7 +39,7 @@ "peerDependencies": { "@reduxjs/toolkit": "^1.6.0 || ^2.0.0", "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0", - "graphql-request": "^3.4.0 || ^4.0.0 || ^5.0.0 || ^6.0.0", + "graphql-request": "^3.4.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0", "graphql-tag": "^2.0.0" }, "peerDependenciesMeta": { @@ -57,7 +57,7 @@ "devDependencies": { "@reduxjs/toolkit": "2.3.0", "@rtk-query/graphql-request-base-query": "2.2.0", - "graphql-request": "^4.0.0" + "graphql-request": "^7.0.0" }, "publishConfig": { "directory": "dist", diff --git a/packages/plugins/typescript/rtk-query/tests/baseApi.ts b/packages/plugins/typescript/rtk-query/tests/baseApi.ts index 2e2be1c62..fceff88a7 100644 --- a/packages/plugins/typescript/rtk-query/tests/baseApi.ts +++ b/packages/plugins/typescript/rtk-query/tests/baseApi.ts @@ -6,5 +6,5 @@ export const client = new GraphQLClient('/graphql'); export const api = createApi({ baseQuery: graphqlRequestBaseQuery({ client }), - endpoints: () => ({}), + endpoints: builder => ({}), }); diff --git a/packages/plugins/typescript/stencil-apollo/tests/stencil-apollo.spec.ts b/packages/plugins/typescript/stencil-apollo/tests/stencil-apollo.spec.ts index aa9b4ef68..e396ae76a 100644 --- a/packages/plugins/typescript/stencil-apollo/tests/stencil-apollo.spec.ts +++ b/packages/plugins/typescript/stencil-apollo/tests/stencil-apollo.spec.ts @@ -1,5 +1,5 @@ import { buildClientSchema } from 'graphql'; -import gql from 'graphql-tag'; +import { gql } from 'graphql-tag'; import { Types } from '@graphql-codegen/plugin-helpers'; import '@graphql-codegen/testing'; import { StencilComponentType } from '../src/config.js'; diff --git a/packages/plugins/typescript/urql/tests/urql.spec.ts b/packages/plugins/typescript/urql/tests/urql.spec.ts index ba00957d6..f96c006d5 100644 --- a/packages/plugins/typescript/urql/tests/urql.spec.ts +++ b/packages/plugins/typescript/urql/tests/urql.spec.ts @@ -1,5 +1,5 @@ import { buildASTSchema, buildClientSchema, GraphQLSchema, parse } from 'graphql'; -import gql from 'graphql-tag'; +import { gql } from 'graphql-tag'; import { mergeOutputs, Types } from '@graphql-codegen/plugin-helpers'; import { validateTs } from '@graphql-codegen/testing'; import { plugin as tsPlugin } from '@graphql-codegen/typescript'; diff --git a/packages/plugins/typescript/vue-apollo-smart-ops/tests/vue-apollo-smart-ops.spec.ts b/packages/plugins/typescript/vue-apollo-smart-ops/tests/vue-apollo-smart-ops.spec.ts index fdc15ed1b..6e4d5156f 100644 --- a/packages/plugins/typescript/vue-apollo-smart-ops/tests/vue-apollo-smart-ops.spec.ts +++ b/packages/plugins/typescript/vue-apollo-smart-ops/tests/vue-apollo-smart-ops.spec.ts @@ -1,5 +1,5 @@ import { buildClientSchema, GraphQLSchema, parse } from 'graphql'; -import gql from 'graphql-tag'; +import { gql } from 'graphql-tag'; import { extract } from 'jest-docblock'; import { mergeOutputs, Types } from '@graphql-codegen/plugin-helpers'; import { validateTs } from '@graphql-codegen/testing'; diff --git a/packages/plugins/typescript/vue-apollo/tests/vue-apollo.spec.ts b/packages/plugins/typescript/vue-apollo/tests/vue-apollo.spec.ts index 50f0c8f4f..f3f12f8e0 100644 --- a/packages/plugins/typescript/vue-apollo/tests/vue-apollo.spec.ts +++ b/packages/plugins/typescript/vue-apollo/tests/vue-apollo.spec.ts @@ -1,5 +1,5 @@ import { buildClientSchema, GraphQLSchema, parse } from 'graphql'; -import gql from 'graphql-tag'; +import { gql } from 'graphql-tag'; import { extract } from 'jest-docblock'; import { mergeOutputs, Types } from '@graphql-codegen/plugin-helpers'; import { validateTs } from '@graphql-codegen/testing'; diff --git a/packages/plugins/typescript/vue-urql/tests/urql.spec.ts b/packages/plugins/typescript/vue-urql/tests/urql.spec.ts index 35ba34d1a..154fb9c46 100644 --- a/packages/plugins/typescript/vue-urql/tests/urql.spec.ts +++ b/packages/plugins/typescript/vue-urql/tests/urql.spec.ts @@ -1,5 +1,5 @@ import { buildClientSchema, GraphQLSchema, parse } from 'graphql'; -import gql from 'graphql-tag'; +import { gql } from 'graphql-tag'; import { mergeOutputs, Types } from '@graphql-codegen/plugin-helpers'; import { validateTs } from '@graphql-codegen/testing'; import { plugin as tsPlugin } from '@graphql-codegen/typescript'; diff --git a/packages/presets/near-operation-file/tests/fixtures/issue-6520.ts b/packages/presets/near-operation-file/tests/fixtures/issue-6520.ts index daab38a44..c9c49cea8 100644 --- a/packages/presets/near-operation-file/tests/fixtures/issue-6520.ts +++ b/packages/presets/near-operation-file/tests/fixtures/issue-6520.ts @@ -1,4 +1,4 @@ -import gql from 'graphql-tag'; +import { gql } from 'graphql-tag'; export const userFields = gql` fragment userFields on User { diff --git a/packages/presets/near-operation-file/tests/fixtures/issue-6546-fragments.ts b/packages/presets/near-operation-file/tests/fixtures/issue-6546-fragments.ts index af9a9e361..944cb9546 100644 --- a/packages/presets/near-operation-file/tests/fixtures/issue-6546-fragments.ts +++ b/packages/presets/near-operation-file/tests/fixtures/issue-6546-fragments.ts @@ -1,4 +1,4 @@ -import gql from 'graphql-tag'; +import { gql } from 'graphql-tag'; export const usernameFragment = gql` fragment usernameFragment on User { diff --git a/packages/presets/near-operation-file/tests/fixtures/issue-6546-queries.ts b/packages/presets/near-operation-file/tests/fixtures/issue-6546-queries.ts index bcdbcd7ac..c4dd7ae85 100644 --- a/packages/presets/near-operation-file/tests/fixtures/issue-6546-queries.ts +++ b/packages/presets/near-operation-file/tests/fixtures/issue-6546-queries.ts @@ -1,4 +1,4 @@ -import gql from 'graphql-tag'; +import { gql } from 'graphql-tag'; import { userFields, usernameFragment } from './issue-6546-fragments.js'; export const limitedUserFieldsQuery = gql` diff --git a/tsconfig.json b/tsconfig.json index 3c602b770..20969717f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,11 +8,10 @@ "allowSyntheticDefaultImports": true, "importHelpers": true, "experimentalDecorators": true, - "module": "esnext", + "module": "NodeNext", "target": "es2018", "lib": ["es6", "esnext", "es2015", "dom"], - "suppressImplicitAnyIndexErrors": true, - "moduleResolution": "node", + "moduleResolution": "NodeNext", "emitDecoratorMetadata": true, "sourceMap": true, "declaration": true, diff --git a/yarn.lock b/yarn.lock index c990ddbe4..a99c9eea3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2171,6 +2171,30 @@ globby "^11.0.0" read-yaml-file "^1.1.0" +"@molt/command@^0.9.0": + version "0.9.0" + resolved "https://registry.yarnpkg.com/@molt/command/-/command-0.9.0.tgz#3c77efe435beb6062da8ba96097f8f82e9bee51c" + integrity sha512-1JI8dAlpqlZoXyKWVQggX7geFNPxBpocHIXQCsnxDjKy+3WX4SGyZVJXuLlqRRrX7FmQCuuMAfx642ovXmPA9g== + dependencies: + "@molt/types" "0.2.0" + alge "0.8.1" + chalk "^5.3.0" + lodash.camelcase "^4.3.0" + lodash.snakecase "^4.1.1" + readline-sync "^1.4.10" + string-length "^6.0.0" + strip-ansi "^7.1.0" + ts-toolbelt "^9.6.0" + type-fest "^4.3.1" + zod "^3.22.2" + +"@molt/types@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@molt/types/-/types-0.2.0.tgz#be19a4c16d944deb93c3d8221170b88eeb9a3085" + integrity sha512-p6ChnEZDGjg9PYPec9BK6Yp5/DdSrYQvXTBAtgrnqX6N36cZy37ql1c8Tc5LclfIYBNG7EZp8NBcRTYJwyi84g== + dependencies: + ts-toolbelt "^9.6.0" + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -2759,6 +2783,16 @@ ajv@^8.0.0, ajv@^8.10.0: require-from-string "^2.0.2" uri-js "^4.2.2" +alge@0.8.1: + version "0.8.1" + resolved "https://registry.yarnpkg.com/alge/-/alge-0.8.1.tgz#f3d8a9ceecaf6d56981ecb2a4804a0e6dd7f4e6b" + integrity sha512-kiV9nTt+XIauAXsowVygDxMZLplZxDWt0W8plE/nB32/V2ziM/P/TxDbSVK7FYIUt2Xo16h3/htDh199LNPCKQ== + dependencies: + lodash.ismatch "^4.4.0" + remeda "^1.0.0" + ts-toolbelt "^9.6.0" + zod "^3.17.3" + ansi-colors@^4.1.1, ansi-colors@^4.1.3: version "4.1.3" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b" @@ -3244,7 +3278,7 @@ chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: ansi-styles "^4.1.0" supports-color "^7.1.0" -chalk@~5.3.0: +chalk@^5.3.0, chalk@~5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.3.0.tgz#67c20a7ebef70e7f3970a01f90fa210cb6860385" integrity sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w== @@ -4596,10 +4630,10 @@ graphql-language-service-utils@^2.7.1: graphql-language-service-types "^1.8.7" nullthrows "^1.0.0" -graphql-request@6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/graphql-request/-/graphql-request-6.0.0.tgz#9c8b6a0c341f289e049936d03cc9205300faae1c" - integrity sha512-2BmHTuglonjZvmNVw6ZzCfFlW/qkIPds0f+Qdi/Lvjsl3whJg2uvHmSvHnLWhUTEw6zcxPYAHiZoPvSVKOZ7Jw== +graphql-request@6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/graphql-request/-/graphql-request-6.1.0.tgz#f4eb2107967af3c7a5907eb3131c671eac89be4f" + integrity sha512-p+XPfS4q7aIpKVcgmnZKhMNqhltk20hfXtkaIkTfjjmiKMJ5xrt5c743cL03y/K7y1rg3WrIC49xGiEQ4mxdNw== dependencies: "@graphql-typed-document-node/core" "^3.2.0" cross-fetch "^3.1.5" @@ -4623,6 +4657,15 @@ graphql-request@^5.0.0: extract-files "^9.0.0" form-data "^3.0.0" +graphql-request@^7.0.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/graphql-request/-/graphql-request-7.1.0.tgz#7b4840f977508f616f22c4168f2347c1dc580868" + integrity sha512-Ouu/lYVFhARS1aXeZoVJWnGT6grFJXTLwXJuK4mUGGRo0EUk1JkyYp43mdGmRgUVezpRm6V5Sq3t8jBDQcajng== + dependencies: + "@graphql-typed-document-node/core" "^3.2.0" + "@molt/command" "^0.9.0" + zod "^3.23.8" + graphql-tag@2.12.6, graphql-tag@^2.11.0, graphql-tag@^2.12.6: version "2.12.6" resolved "https://registry.yarnpkg.com/graphql-tag/-/graphql-tag-2.12.6.tgz#d441a569c1d2537ef10ca3d1633b48725329b5f1" @@ -5774,6 +5817,11 @@ locate-path@^6.0.0: dependencies: p-locate "^5.0.0" +lodash.camelcase@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" + integrity sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA== + lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" @@ -5799,6 +5847,11 @@ lodash.isinteger@^4.0.4: resolved "https://registry.yarnpkg.com/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz#619c0af3d03f8b04c31f5882840b77b11cd68343" integrity sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA== +lodash.ismatch@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz#756cb5150ca3ba6f11085a78849645f188f85f37" + integrity sha512-fPMfXjGQEV9Xsq/8MTSgUf255gawYRbjwMyDbcvDhXgV7enSZA0hynz6vMPnpAb5iONEzBHBPsT+0zes5Z301g== + lodash.isnumber@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz#3ce76810c5928d03352301ac287317f11c0b1ffc" @@ -5834,6 +5887,11 @@ lodash.once@^4.0.0: resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" integrity sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg== +lodash.snakecase@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz#39d714a35357147837aefd64b5dcbb16becd8f8d" + integrity sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw== + lodash.startcase@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.startcase/-/lodash.startcase-4.4.0.tgz#9436e34ed26093ed7ffae1936144350915d9add8" @@ -6642,6 +6700,11 @@ readdirp@~3.6.0: dependencies: picomatch "^2.2.1" +readline-sync@^1.4.10: + version "1.4.10" + resolved "https://registry.yarnpkg.com/readline-sync/-/readline-sync-1.4.10.tgz#41df7fbb4b6312d673011594145705bf56d8873b" + integrity sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw== + redux-thunk@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-3.1.0.tgz#94aa6e04977c30e14e892eae84978c1af6058ff3" @@ -6724,6 +6787,11 @@ relay-runtime@12.0.0: fbjs "^3.0.0" invariant "^2.2.4" +remeda@^1.0.0: + version "1.61.0" + resolved "https://registry.yarnpkg.com/remeda/-/remeda-1.61.0.tgz#dccd31ab75d0f02865f3ef89e4f0ce0076096464" + integrity sha512-caKfSz9rDeSKBQQnlJnVW3mbVdFgxgGWQKq1XlFokqjf+hQD5gxutLGTTY2A/x24UxVyJe9gH5fAkFI63ULw4A== + remedial@^1.0.7: version "1.0.8" resolved "https://registry.yarnpkg.com/remedial/-/remedial-1.0.8.tgz#a5e4fd52a0e4956adbaf62da63a5a46a78c578a0" @@ -7147,6 +7215,13 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" +string-length@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-6.0.0.tgz#1c7342bbf032129b2f80003e69f889c70231d791" + integrity sha512-1U361pxZHEQ+FeSjzqRpV+cu2vTzYeWeafXFLykiFlv4Vc0n3njgU8HrMbyik5uwm77naWMuVG8fhEF+Ovb1Kg== + dependencies: + strip-ansi "^7.1.0" + "string-width-cjs@npm:string-width@^4.2.0": version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" @@ -7416,6 +7491,11 @@ ts-node@10.9.2, ts-node@^10.8.1: v8-compile-cache-lib "^3.0.1" yn "3.1.1" +ts-toolbelt@^9.6.0: + version "9.6.0" + resolved "https://registry.yarnpkg.com/ts-toolbelt/-/ts-toolbelt-9.6.0.tgz#50a25426cfed500d4a09bd1b3afb6f28879edfd5" + integrity sha512-nsZd8ZeNUzukXPlJmTBwUAuABDe/9qtVDelJeT/qW0ow3ZS3BsQJtNkan1802aM9Uf68/Y8ljw86Hu0h5IUW3w== + tsconfig-paths@^3.15.0: version "3.15.0" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz#5299ec605e55b1abb23ec939ef15edaf483070d4" @@ -7458,6 +7538,11 @@ type-fest@^0.21.3: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== +type-fest@^4.3.1: + version "4.26.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-4.26.0.tgz#703f263af10c093cd6277d079e26b9e17d517c4b" + integrity sha512-OduNjVJsFbifKb57UqZ2EMP1i4u64Xwow3NYXUtBbD4vIwJdQd4+xl8YDou1dlm4DVrtwT/7Ky8z8WyCULVfxw== + typed-array-buffer@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz#1867c5d83b20fcb5ccf32649e5e2fc7424474ff3" @@ -7921,7 +8006,7 @@ zen-observable@0.8.15: resolved "https://registry.yarnpkg.com/zen-observable/-/zen-observable-0.8.15.tgz#96415c512d8e3ffd920afd3889604e30b9eaac15" integrity sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ== -zod@^3.20.2: - version "3.21.4" - resolved "https://registry.yarnpkg.com/zod/-/zod-3.21.4.tgz#10882231d992519f0a10b5dd58a38c9dabbb64db" - integrity sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw== +zod@^3.17.3, zod@^3.20.2, zod@^3.22.2, zod@^3.23.8: + version "3.23.8" + resolved "https://registry.yarnpkg.com/zod/-/zod-3.23.8.tgz#e37b957b5d52079769fb8097099b592f0ef4067d" + integrity sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==