-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* doc: (#279) adding project with custom client * feat: (#279) enabling custom clients as well as server-side clients, adding custom client to getting-started * feat: (#279) enabling ssr for authenticated client requests
- Loading branch information
Showing
28 changed files
with
20,474 additions
and
318 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const dotenv = require('dotenv'); | ||
|
||
dotenv.config({ | ||
path: '.env.local', | ||
}); | ||
|
||
/** | ||
* @type {import("@gqless/cli").GQlessConfig} | ||
*/ | ||
const config = { | ||
react: false, | ||
scalarTypes: { DateTime: 'string' }, | ||
introspection: { | ||
endpoint: `${ | ||
process.env.NEXT_PUBLIC_WORDPRESS_URL ?? process.env.WORDPRESS_URL | ||
}/graphql`, | ||
headers: {}, | ||
}, | ||
destination: './src/client/index.ts', | ||
subscriptions: false, | ||
javascriptOutput: false, | ||
}; | ||
|
||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* GQLESS: You can safely modify this file and Query Fetcher based on your needs | ||
*/ | ||
import type { IncomingMessage } from 'http'; | ||
import { getClient } from '@wpengine/headless-next'; | ||
import { | ||
generatedSchema, | ||
scalarsEnumsHash, | ||
GeneratedSchema, | ||
SchemaObjectTypes, | ||
SchemaObjectTypesNames, | ||
} from './schema.generated'; | ||
|
||
export const client = getClient< | ||
GeneratedSchema, | ||
SchemaObjectTypesNames, | ||
SchemaObjectTypes | ||
>({ | ||
schema: generatedSchema, | ||
scalarsEnumsHash, | ||
}); | ||
|
||
export function serverClient(req: IncomingMessage) { | ||
return getClient<GeneratedSchema, SchemaObjectTypesNames, SchemaObjectTypes>({ | ||
schema: generatedSchema, | ||
scalarsEnumsHash, | ||
context: req, | ||
}); | ||
} | ||
|
||
export * from './schema.generated'; |
19,870 changes: 19,870 additions & 0 deletions
19,870
examples/next/getting-started/src/client/schema.generated.ts
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.