Skip to content

Instantly share code, notes, and snippets.

@emmiep
Created May 27, 2021 14:29
Show Gist options
  • Save emmiep/d38ac2df07103f6fc2ebd2b00408d0a5 to your computer and use it in GitHub Desktop.
Save emmiep/d38ac2df07103f6fc2ebd2b00408d0a5 to your computer and use it in GitHub Desktop.
VSCode next+graphql setup
/** @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;
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