diff --git a/examples/react/apollo-client-swc-plugin/codegen.ts b/examples/react/apollo-client-swc-plugin/codegen.ts index 6d94d628656..e5659749776 100644 --- a/examples/react/apollo-client-swc-plugin/codegen.ts +++ b/examples/react/apollo-client-swc-plugin/codegen.ts @@ -2,7 +2,7 @@ import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { - schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index', + schema: 'https://graphql.org/graphql/', documents: ['src/**/*.tsx', '!src/gql/**/*'], generates: { './src/gql/': { diff --git a/examples/react/apollo-client-swc-plugin/src/main.tsx b/examples/react/apollo-client-swc-plugin/src/main.tsx index 38a4b988a06..78460ab9f19 100644 --- a/examples/react/apollo-client-swc-plugin/src/main.tsx +++ b/examples/react/apollo-client-swc-plugin/src/main.tsx @@ -5,7 +5,7 @@ import App from './App'; import { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client'; const client = new ApolloClient({ - uri: 'https://swapi-graphql.netlify.app/.netlify/functions/index', + uri: 'https://graphql.org/graphql/', cache: new InMemoryCache(), }); diff --git a/examples/react/apollo-client/codegen.ts b/examples/react/apollo-client/codegen.ts index f9349ada86b..7b44188aa51 100644 --- a/examples/react/apollo-client/codegen.ts +++ b/examples/react/apollo-client/codegen.ts @@ -2,7 +2,7 @@ import { type CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { - schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index', + schema: 'https://graphql.org/graphql/', documents: ['src/**/*.tsx'], generates: { './src/gql/': { diff --git a/examples/react/apollo-client/src/main.tsx b/examples/react/apollo-client/src/main.tsx index 38a4b988a06..78460ab9f19 100644 --- a/examples/react/apollo-client/src/main.tsx +++ b/examples/react/apollo-client/src/main.tsx @@ -5,7 +5,7 @@ import App from './App'; import { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client'; const client = new ApolloClient({ - uri: 'https://swapi-graphql.netlify.app/.netlify/functions/index', + uri: 'https://graphql.org/graphql/', cache: new InMemoryCache(), }); diff --git a/examples/react/http-executor/codegen.ts b/examples/react/http-executor/codegen.ts index 24d3dee67fe..e5c6affee72 100644 --- a/examples/react/http-executor/codegen.ts +++ b/examples/react/http-executor/codegen.ts @@ -2,7 +2,7 @@ import { type CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { - schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index', + schema: 'https://graphql.org/graphql/', documents: ['src/**/*.tsx'], generates: { './src/gql/': { diff --git a/examples/react/http-executor/src/App.tsx b/examples/react/http-executor/src/App.tsx index 4c4e4050432..74839d55d52 100644 --- a/examples/react/http-executor/src/App.tsx +++ b/examples/react/http-executor/src/App.tsx @@ -5,7 +5,7 @@ import Film from './Film'; import { graphql, DocumentType } from './gql'; const executor = buildHTTPExecutor({ - endpoint: 'https://swapi-graphql.netlify.app/.netlify/functions/index', + endpoint: 'https://graphql.org/graphql/', }); const AllFilmsWithVariablesQuery = graphql(/* GraphQL */ ` @@ -21,7 +21,7 @@ const AllFilmsWithVariablesQuery = graphql(/* GraphQL */ ` `); // we could also define a client: -// `const client = new GraphQLClient('https://swapi-graphql.netlify.app/.netlify/functions/index')` +// `const client = new GraphQLClient('https://graphql.org/graphql/')` // and use: // `client.request(allFilmsWithVariablesQueryDocument, { first: 10 })` diff --git a/examples/react/nextjs-swr/codegen.ts b/examples/react/nextjs-swr/codegen.ts index 0d77bb118c1..22724d9bb60 100644 --- a/examples/react/nextjs-swr/codegen.ts +++ b/examples/react/nextjs-swr/codegen.ts @@ -2,7 +2,7 @@ import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { - schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index', + schema: 'https://graphql.org/graphql/', documents: ['components/**/*.tsx', 'pages/**/*.tsx'], generates: { './gql/': { diff --git a/examples/react/nextjs-swr/hooks/use-query.ts b/examples/react/nextjs-swr/hooks/use-query.ts index 4098644c9d9..9a1f23af082 100644 --- a/examples/react/nextjs-swr/hooks/use-query.ts +++ b/examples/react/nextjs-swr/hooks/use-query.ts @@ -5,7 +5,7 @@ import { ASTNode, ExecutionResult, Kind, OperationDefinitionNode } from 'graphql import useSWR from 'swr'; const executor = buildHTTPExecutor({ - endpoint: 'https://swapi-graphql.netlify.app/.netlify/functions/index', + endpoint: 'https://graphql.org/graphql/', }); const isOperationDefinition = (def: ASTNode): def is OperationDefinitionNode => def.kind === Kind.OPERATION_DEFINITION; diff --git a/examples/react/tanstack-react-query/codegen.ts b/examples/react/tanstack-react-query/codegen.ts index 1a100a3ccf1..9a807bb2f7b 100644 --- a/examples/react/tanstack-react-query/codegen.ts +++ b/examples/react/tanstack-react-query/codegen.ts @@ -2,7 +2,7 @@ import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { - schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index', + schema: 'https://graphql.org/graphql/', documents: ['src/**/*.tsx', '!src/gql/**/*'], generates: { './src/gql/': { diff --git a/examples/react/tanstack-react-query/src/use-graphql.ts b/examples/react/tanstack-react-query/src/use-graphql.ts index 97131041e0d..85387862f4d 100644 --- a/examples/react/tanstack-react-query/src/use-graphql.ts +++ b/examples/react/tanstack-react-query/src/use-graphql.ts @@ -14,7 +14,7 @@ export function useGraphQL( variables, ] as const, async ({ queryKey }) => { - return fetch('https://swapi-graphql.netlify.app/.netlify/functions/index', { + return fetch('https://graphql.org/graphql/', { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/examples/react/urql/codegen.ts b/examples/react/urql/codegen.ts index abe3f780e4f..44d3f90219e 100644 --- a/examples/react/urql/codegen.ts +++ b/examples/react/urql/codegen.ts @@ -2,7 +2,7 @@ import { type CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { - schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index', + schema: 'https://graphql.org/graphql/', documents: ['src/**/*.tsx', '!src/gql/**/*'], generates: { './src/gql/': { diff --git a/examples/react/urql/src/main.tsx b/examples/react/urql/src/main.tsx index 09887543cb6..908e3bf3804 100644 --- a/examples/react/urql/src/main.tsx +++ b/examples/react/urql/src/main.tsx @@ -6,7 +6,7 @@ import './main.css'; import App from './App'; const client = createClient({ - url: 'https://swapi-graphql.netlify.app/.netlify/functions/index', + url: 'https://graphql.org/graphql/', }); const root = ReactDOM.createRoot(document.getElementById('app') as HTMLElement); diff --git a/examples/typescript-esm/codegen.cjs b/examples/typescript-esm/codegen.cjs index 25028679905..9e6e7ef44f9 100644 --- a/examples/typescript-esm/codegen.cjs +++ b/examples/typescript-esm/codegen.cjs @@ -2,7 +2,7 @@ /** @type {import("@graphql-codegen/cli").CodegenConfig} */ const config = { - schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index', + schema: 'https://graphql.org/graphql/', documents: ['src/**/*.ts'], emitLegacyCommonJSImports: false, generates: { diff --git a/examples/typescript-esm/src/main.ts b/examples/typescript-esm/src/main.ts index 1451a70b3d6..3a2acb3596e 100644 --- a/examples/typescript-esm/src/main.ts +++ b/examples/typescript-esm/src/main.ts @@ -32,7 +32,7 @@ const AllPeopleWithVariablesQueryDocument = graphql(/* GraphQL */ ` } `); -const apiUrl = 'https://swapi-graphql.netlify.app/.netlify/functions/index'; +const apiUrl = 'https://graphql.org/graphql/'; executeOperation(apiUrl, AllPeopleQueryDocument).then(res => { if (res.errors) { diff --git a/examples/typescript-graphql-request/codegen.ts b/examples/typescript-graphql-request/codegen.ts index 8152d8f114c..c712bf6cccc 100644 --- a/examples/typescript-graphql-request/codegen.ts +++ b/examples/typescript-graphql-request/codegen.ts @@ -2,7 +2,7 @@ import { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { - schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index', + schema: 'https://graphql.org/graphql/', documents: ['src/**/*.ts'], generates: { './src/gql/': { diff --git a/examples/typescript-graphql-request/src/main.ts b/examples/typescript-graphql-request/src/main.ts index bc74b4f8154..80e3ca9cf54 100644 --- a/examples/typescript-graphql-request/src/main.ts +++ b/examples/typescript-graphql-request/src/main.ts @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ import { GraphQLClient } from 'graphql-request'; import { graphql } from './gql'; import { AllPeopleQueryQuery } from './gql/graphql'; @@ -33,7 +32,7 @@ const AllPeopleWithVariablesQueryDocument = graphql(/* GraphQL */ ` } `); -const apiUrl = 'https://swapi-graphql.netlify.app/.netlify/functions/index'; +const apiUrl = 'https://graphql.org/graphql/'; const client = new GraphQLClient(apiUrl); diff --git a/examples/vite/vite-react-cts/codegen.cts b/examples/vite/vite-react-cts/codegen.cts index 24d3dee67fe..e5c6affee72 100644 --- a/examples/vite/vite-react-cts/codegen.cts +++ b/examples/vite/vite-react-cts/codegen.cts @@ -2,7 +2,7 @@ import { type CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { - schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index', + schema: 'https://graphql.org/graphql/', documents: ['src/**/*.tsx'], generates: { './src/gql/': { diff --git a/examples/vite/vite-react-cts/src/main.tsx b/examples/vite/vite-react-cts/src/main.tsx index a7ae3a62dc5..ac18ca5c31d 100644 --- a/examples/vite/vite-react-cts/src/main.tsx +++ b/examples/vite/vite-react-cts/src/main.tsx @@ -5,7 +5,7 @@ import { graphql } from './gql'; import { ApolloClient, InMemoryCache, ApolloProvider, useQuery } from '@apollo/client'; const client = new ApolloClient({ - uri: 'https://swapi-graphql.netlify.app/.netlify/functions/index', + uri: 'https://graphql.org/graphql/', cache: new InMemoryCache(), }); diff --git a/examples/vite/vite-react-mts/codegen.mts b/examples/vite/vite-react-mts/codegen.mts index 24d3dee67fe..e5c6affee72 100644 --- a/examples/vite/vite-react-mts/codegen.mts +++ b/examples/vite/vite-react-mts/codegen.mts @@ -2,7 +2,7 @@ import { type CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { - schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index', + schema: 'https://graphql.org/graphql/', documents: ['src/**/*.tsx'], generates: { './src/gql/': { diff --git a/examples/vite/vite-react-mts/src/main.tsx b/examples/vite/vite-react-mts/src/main.tsx index a7ae3a62dc5..ac18ca5c31d 100644 --- a/examples/vite/vite-react-mts/src/main.tsx +++ b/examples/vite/vite-react-mts/src/main.tsx @@ -5,7 +5,7 @@ import { graphql } from './gql'; import { ApolloClient, InMemoryCache, ApolloProvider, useQuery } from '@apollo/client'; const client = new ApolloClient({ - uri: 'https://swapi-graphql.netlify.app/.netlify/functions/index', + uri: 'https://graphql.org/graphql/', cache: new InMemoryCache(), }); diff --git a/examples/vite/vite-react-ts/codegen.ts b/examples/vite/vite-react-ts/codegen.ts index 24d3dee67fe..e5c6affee72 100644 --- a/examples/vite/vite-react-ts/codegen.ts +++ b/examples/vite/vite-react-ts/codegen.ts @@ -2,7 +2,7 @@ import { type CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { - schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index', + schema: 'https://graphql.org/graphql/', documents: ['src/**/*.tsx'], generates: { './src/gql/': { diff --git a/examples/vite/vite-react-ts/src/main.tsx b/examples/vite/vite-react-ts/src/main.tsx index a7ae3a62dc5..ac18ca5c31d 100644 --- a/examples/vite/vite-react-ts/src/main.tsx +++ b/examples/vite/vite-react-ts/src/main.tsx @@ -5,7 +5,7 @@ import { graphql } from './gql'; import { ApolloClient, InMemoryCache, ApolloProvider, useQuery } from '@apollo/client'; const client = new ApolloClient({ - uri: 'https://swapi-graphql.netlify.app/.netlify/functions/index', + uri: 'https://graphql.org/graphql/', cache: new InMemoryCache(), }); diff --git a/examples/vue/apollo-composable/codegen.ts b/examples/vue/apollo-composable/codegen.ts index ab5b5d09dbf..3e62ad5160a 100644 --- a/examples/vue/apollo-composable/codegen.ts +++ b/examples/vue/apollo-composable/codegen.ts @@ -1,7 +1,7 @@ import type { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { - schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index', + schema: 'https://graphql.org/graphql/', documents: ['src/**/*.vue', '!src/gql/**/*'], generates: { './src/gql/': { diff --git a/examples/vue/apollo-composable/src/main.ts b/examples/vue/apollo-composable/src/main.ts index 9baa55efe7e..34ba6296a55 100644 --- a/examples/vue/apollo-composable/src/main.ts +++ b/examples/vue/apollo-composable/src/main.ts @@ -5,7 +5,7 @@ import { ApolloClient, HttpLink, InMemoryCache } from '@apollo/client/core'; import App from './App.vue'; const httpLink = new HttpLink({ - uri: 'https://swapi-graphql.netlify.app/.netlify/functions/index', + uri: 'https://graphql.org/graphql/', }); // Create the apollo client diff --git a/examples/vue/urql/codegen.ts b/examples/vue/urql/codegen.ts index ab5b5d09dbf..3e62ad5160a 100644 --- a/examples/vue/urql/codegen.ts +++ b/examples/vue/urql/codegen.ts @@ -1,7 +1,7 @@ import type { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { - schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index', + schema: 'https://graphql.org/graphql/', documents: ['src/**/*.vue', '!src/gql/**/*'], generates: { './src/gql/': { diff --git a/examples/vue/urql/src/main.ts b/examples/vue/urql/src/main.ts index a74062abb03..1c20230023b 100644 --- a/examples/vue/urql/src/main.ts +++ b/examples/vue/urql/src/main.ts @@ -5,7 +5,7 @@ import App from './App.vue'; const app = createApp(App); app.use(urql, { - url: 'https://swapi-graphql.netlify.app/.netlify/functions/index', + url: 'https://graphql.org/graphql/', exchanges: [cacheExchange, fetchExchange], }); diff --git a/examples/vue/villus/codegen.ts b/examples/vue/villus/codegen.ts index ab5b5d09dbf..3e62ad5160a 100644 --- a/examples/vue/villus/codegen.ts +++ b/examples/vue/villus/codegen.ts @@ -1,7 +1,7 @@ import type { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { - schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index', + schema: 'https://graphql.org/graphql/', documents: ['src/**/*.vue', '!src/gql/**/*'], generates: { './src/gql/': { diff --git a/examples/vue/villus/src/App.vue b/examples/vue/villus/src/App.vue index 69b3a95a7a7..d86611c1ea3 100644 --- a/examples/vue/villus/src/App.vue +++ b/examples/vue/villus/src/App.vue @@ -5,7 +5,7 @@ import FilmItem from './components/FilmItem.vue'; import { computed } from 'vue'; useClient({ - url: 'https://swapi-graphql.netlify.app/.netlify/functions/index', + url: 'https://graphql.org/graphql/', }); const { data } = useQuery({ diff --git a/packages/presets/client/CHANGELOG.md b/packages/presets/client/CHANGELOG.md index e3068f725d9..f4f643e8f58 100644 --- a/packages/presets/client/CHANGELOG.md +++ b/packages/presets/client/CHANGELOG.md @@ -566,7 +566,7 @@ import { CodegenConfig } from '@graphql-codegen/cli' const config: CodegenConfig = { - schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index', + schema: 'https://graphql.org/graphql/', documents: ['src/**/*.tsx'], ignoreNoDocuments: true, // for better experience with the watcher generates: { @@ -614,7 +614,7 @@ import { CodegenConfig } from '@graphql-codegen/cli' const config: CodegenConfig = { - schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index', + schema: 'https://graphql.org/graphql/', documents: ['src/**/*.tsx'], ignoreNoDocuments: true, // for better experience with the watcher generates: { diff --git a/packages/presets/client/src/index.ts b/packages/presets/client/src/index.ts index 920a13a5f08..d4217659043 100644 --- a/packages/presets/client/src/index.ts +++ b/packages/presets/client/src/index.ts @@ -25,7 +25,7 @@ export type ClientPresetConfig = { * @exampleMarkdown * ```tsx * const config = { - * schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index', + * schema: 'https://graphql.org/graphql/', * documents: ['src/**\/*.tsx', '!src\/gql/**\/*'], * generates: { * './src/gql/': { @@ -49,7 +49,7 @@ export type ClientPresetConfig = { * @exampleMarkdown * ```tsx * const config = { - * schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index', + * schema: 'https://graphql.org/graphql/', * documents: ['src/**\/*.tsx', '!src\/gql/**\/*'], * generates: { * './src/gql/': { diff --git a/website/src/pages/docs/guides/react-query.mdx b/website/src/pages/docs/guides/react-query.mdx index 5efff71f108..6e4e732d326 100644 --- a/website/src/pages/docs/guides/react-query.mdx +++ b/website/src/pages/docs/guides/react-query.mdx @@ -44,7 +44,7 @@ contents: import type { CodegenConfig } from '@graphql-codegen/cli' const config: CodegenConfig = { - schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index', + schema: 'https://graphql.org/graphql/', documents: ['src/**/*.tsx'], ignoreNoDocuments: true, generates: { @@ -170,7 +170,7 @@ export async function execute( query: TypedDocumentString, ...[variables]: TVariables extends Record ? [] : [TVariables] ) { - const response = await fetch('https://swapi-graphql.netlify.app/.netlify/functions/index', { + const response = await fetch('https://graphql.org/graphql/', { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/website/src/pages/docs/guides/react-vue.mdx b/website/src/pages/docs/guides/react-vue.mdx index 70bb45bcdb8..ef9157169b7 100644 --- a/website/src/pages/docs/guides/react-vue.mdx +++ b/website/src/pages/docs/guides/react-vue.mdx @@ -8,7 +8,7 @@ import { Tabs, Callout } from '@theguild/components' GraphQL Code Generator provides a unified way to get TypeScript types from GraphQL operations for [most modern GraphQL clients and frameworks](#appendix-ii-compatibility). -This guide is built using the [Star wars films demo API](https://swapi-graphql.netlify.app/.netlify/functions/index). +This guide is built using the [Star wars films demo API](https://graphql.org/graphql/). We will build a simple GraphQL front-end app using the following Query to fetch the list of Star Wars films: @@ -62,7 +62,7 @@ Then provide the corresponding framework-specific configuration: import type { CodegenConfig } from '@graphql-codegen/cli' const config: CodegenConfig = { - schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index', + schema: 'https://graphql.org/graphql/', documents: ['src/**/*.tsx'], ignoreNoDocuments: true, // for better experience with the watcher generates: { @@ -83,7 +83,7 @@ export default config import type { CodegenConfig } from '@graphql-codegen/cli' const config: CodegenConfig = { - schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index', + schema: 'https://graphql.org/graphql/', documents: ['src/**/*.vue'], ignoreNoDocuments: true, // for better experience with the watcher generates: { @@ -184,7 +184,7 @@ const allFilmsWithVariablesQueryDocument = graphql(/* GraphQL */ ` function App() { // `data` is typed! const { data } = useQuery(['films'], async () => - request('https://swapi-graphql.netlify.app/.netlify/functions/index', allFilmsWithVariablesQueryDocument, { + request('https://graphql.org/graphql/', allFilmsWithVariablesQueryDocument, { first: 10 // variables are typed too! }) ) @@ -535,11 +535,7 @@ export function useGraphQL( ...[variables]: TVariables extends Record ? [] : [TVariables] ): UseQueryResult { return useQuery([(document.definitions[0] as any).name.value, variables], async ({ queryKey }) => - request( - 'https://swapi-graphql.netlify.app/.netlify/functions/index', - document, - queryKey[1] ? queryKey[1] : undefined - ) + request('https://graphql.org/graphql/', document, queryKey[1] ? queryKey[1] : undefined) ) } ``` @@ -623,7 +619,7 @@ export function useGraphQL( ...[variables]: TVariables extends Record ? [] : [TVariables] ): UseQueryResult> { return useQuery([(document.definitions[0] as any).name.value, variables], () => - customFetcher('https://swapi-graphql.netlify.app/.netlify/functions/index', document, variables) + customFetcher('https://graphql.org/graphql/', document, variables) ) } ``` diff --git a/website/src/pages/docs/guides/vanilla-typescript.mdx b/website/src/pages/docs/guides/vanilla-typescript.mdx index af47e590bc8..b6dbacdfb50 100644 --- a/website/src/pages/docs/guides/vanilla-typescript.mdx +++ b/website/src/pages/docs/guides/vanilla-typescript.mdx @@ -60,7 +60,7 @@ contents: import type { CodegenConfig } from '@graphql-codegen/cli' const config: CodegenConfig = { - schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index', + schema: 'https://graphql.org/graphql/', documents: ['src/**/*.ts'], ignoreNoDocuments: true, generates: { @@ -187,7 +187,7 @@ export async function execute( query: TypedDocumentString, ...[variables]: TVariables extends Record ? [] : [TVariables] ) { - const response = await fetch('https://swapi-graphql.netlify.app/.netlify/functions/index', { + const response = await fetch('https://graphql.org/graphql/', { method: 'POST', headers: { 'Content-Type': 'application/json',