Created
May 27, 2021 14:29
-
-
Save emmiep/d38ac2df07103f6fc2ebd2b00408d0a5 to your computer and use it in GitHub Desktop.
VSCode next+graphql setup
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
/** @typedef {import("graphql-config").IGraphQLConfig} IGraphQLConfig */ | |
const {loadEnvConfig} = require('@next/env'); | |
loadEnvConfig(__dirname, true); | |
/** @type IGraphQLConfig */ | |
const config = { | |
schema: process.env.GRAPHCMS_ENDPOINT, | |
extensions: { | |
endpoints: { | |
default: { | |
url: process.env.GRAPHCMS_ENDPOINT, | |
headers: { | |
'Authorization': `Bearer ${process.env.GRAPHCMS_TOKEN}`, | |
}, | |
}, | |
}, | |
}, | |
}; | |
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
import {IExtensions} from 'graphql-config'; | |
import {Endpoints} from 'graphql-config/extensions/endpoints'; | |
declare module 'graphql-config' { | |
interface IExtensions { | |
endpoints?: Endpoints; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment