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

fix(deps): support graphql-request v7 for @graphql-codegen/typescript-graphql-request #879

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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`)
Original file line number Diff line number Diff line change
@@ -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`)

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dev-test/githunt/jit-sdk.ts
Original file line number Diff line number Diff line change
@@ -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> = T | null;
Expand Down
2 changes: 1 addition & 1 deletion dev-test/githunt/types.reactApollo.v2.tsx
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
2 changes: 1 addition & 1 deletion dev-test/githunt/types.stencilApollo.tsx
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
2 changes: 1 addition & 1 deletion dev-test/githunt/types.urql.tsx
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 1 addition & 1 deletion dev-test/githunt/types.vueApollo.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
2 changes: 1 addition & 1 deletion dev-test/githunt/types.vueApolloSmartOps.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ApolloError } from 'apollo-client';
import gql from 'graphql-tag';
import { gql } from 'graphql-tag';
import {
createMutationFunction,
createSmartQueryOptionsFunction,
Expand Down
2 changes: 1 addition & 1 deletion dev-test/test-message/documents.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import gql from 'graphql-tag';
import { gql } from 'graphql-tag';

// tslint:disable-next-line:variable-name
export const GetMessages = gql`
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/c-sharp/c-sharp-operations/src/index.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
3 changes: 2 additions & 1 deletion packages/plugins/c-sharp/c-sharp/test/c-sharp.spec.ts
Original file line number Diff line number Diff line change
@@ -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 () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/flow/resolvers/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<FlowResolversPluginConfig, Types.ComplexPluginOutput> = (
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/typescript/graphql-request/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
@@ -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 });
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/typescript/mongodb/src/index.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/typescript/nest/tests/nest.spec.ts
Original file line number Diff line number Diff line change
@@ -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 () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/typescript/nhost/src/index.ts
Original file line number Diff line number Diff line change
@@ -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> = T extends Promise<infer U> ? U : T;

Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/typescript/rtk-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/typescript/rtk-query/tests/baseApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ export const client = new GraphQLClient('/graphql');

export const api = createApi({
baseQuery: graphqlRequestBaseQuery({ client }),
endpoints: () => ({}),
endpoints: builder => ({}),
});
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/typescript/urql/tests/urql.spec.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/typescript/vue-urql/tests/urql.spec.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import gql from 'graphql-tag';
import { gql } from 'graphql-tag';

export const userFields = gql`
fragment userFields on User {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import gql from 'graphql-tag';
import { gql } from 'graphql-tag';

export const usernameFragment = gql`
fragment usernameFragment on User {
Expand Down
Original file line number Diff line number Diff line change
@@ -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`
Expand Down
5 changes: 2 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading