Skip to content

Commit 05d9731

Browse files
authored
Switch to use stable SWAPI endpoint in examples (#10242)
1 parent 35d9365 commit 05d9731

File tree

33 files changed

+43
-48
lines changed

33 files changed

+43
-48
lines changed

examples/react/apollo-client-swc-plugin/codegen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { CodegenConfig } from '@graphql-codegen/cli';
33

44
const config: CodegenConfig = {
5-
schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index',
5+
schema: 'https://graphql.org/graphql/',
66
documents: ['src/**/*.tsx', '!src/gql/**/*'],
77
generates: {
88
'./src/gql/': {

examples/react/apollo-client-swc-plugin/src/main.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import App from './App';
55
import { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';
66

77
const client = new ApolloClient({
8-
uri: 'https://swapi-graphql.netlify.app/.netlify/functions/index',
8+
uri: 'https://graphql.org/graphql/',
99
cache: new InMemoryCache(),
1010
});
1111

examples/react/apollo-client/codegen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { type CodegenConfig } from '@graphql-codegen/cli';
33

44
const config: CodegenConfig = {
5-
schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index',
5+
schema: 'https://graphql.org/graphql/',
66
documents: ['src/**/*.tsx'],
77
generates: {
88
'./src/gql/': {

examples/react/apollo-client/src/main.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import App from './App';
55
import { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';
66

77
const client = new ApolloClient({
8-
uri: 'https://swapi-graphql.netlify.app/.netlify/functions/index',
8+
uri: 'https://graphql.org/graphql/',
99
cache: new InMemoryCache(),
1010
});
1111

examples/react/http-executor/codegen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { type CodegenConfig } from '@graphql-codegen/cli';
33

44
const config: CodegenConfig = {
5-
schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index',
5+
schema: 'https://graphql.org/graphql/',
66
documents: ['src/**/*.tsx'],
77
generates: {
88
'./src/gql/': {

examples/react/http-executor/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Film from './Film';
55
import { graphql, DocumentType } from './gql';
66

77
const executor = buildHTTPExecutor({
8-
endpoint: 'https://swapi-graphql.netlify.app/.netlify/functions/index',
8+
endpoint: 'https://graphql.org/graphql/',
99
});
1010

1111
const AllFilmsWithVariablesQuery = graphql(/* GraphQL */ `
@@ -21,7 +21,7 @@ const AllFilmsWithVariablesQuery = graphql(/* GraphQL */ `
2121
`);
2222

2323
// we could also define a client:
24-
// `const client = new GraphQLClient('https://swapi-graphql.netlify.app/.netlify/functions/index')`
24+
// `const client = new GraphQLClient('https://graphql.org/graphql/')`
2525
// and use:
2626
// `client.request(allFilmsWithVariablesQueryDocument, { first: 10 })`
2727

examples/react/nextjs-swr/codegen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { CodegenConfig } from '@graphql-codegen/cli';
33

44
const config: CodegenConfig = {
5-
schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index',
5+
schema: 'https://graphql.org/graphql/',
66
documents: ['components/**/*.tsx', 'pages/**/*.tsx'],
77
generates: {
88
'./gql/': {

examples/react/nextjs-swr/hooks/use-query.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { ASTNode, ExecutionResult, Kind, OperationDefinitionNode } from 'graphql
55
import useSWR from 'swr';
66

77
const executor = buildHTTPExecutor({
8-
endpoint: 'https://swapi-graphql.netlify.app/.netlify/functions/index',
8+
endpoint: 'https://graphql.org/graphql/',
99
});
1010

1111
const isOperationDefinition = (def: ASTNode): def is OperationDefinitionNode => def.kind === Kind.OPERATION_DEFINITION;

examples/react/tanstack-react-query/codegen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { CodegenConfig } from '@graphql-codegen/cli';
33

44
const config: CodegenConfig = {
5-
schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index',
5+
schema: 'https://graphql.org/graphql/',
66
documents: ['src/**/*.tsx', '!src/gql/**/*'],
77
generates: {
88
'./src/gql/': {

examples/react/tanstack-react-query/src/use-graphql.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export function useGraphQL<TResult, TVariables>(
1414
variables,
1515
] as const,
1616
async ({ queryKey }) => {
17-
return fetch('https://swapi-graphql.netlify.app/.netlify/functions/index', {
17+
return fetch('https://graphql.org/graphql/', {
1818
method: 'POST',
1919
headers: {
2020
'Content-Type': 'application/json',

0 commit comments

Comments
 (0)