Created
May 25, 2020 08:09
-
-
Save m-muhsin/f113874a937d64fdae3f05eaec9d8244 to your computer and use it in GitHub Desktop.
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
{ | |
resolve: `gatsby-source-wordpress-experimental`, | |
options: { | |
url: | |
process.env.WPGRAPHQL_URL || | |
`https://dev-gatsby-source-wordpress-v4.pantheonsite.io/graphql`, | |
verbose: true, | |
schema: { | |
queryDepth: 5, | |
typePrefix: `Wp`, | |
timeout: 30000, | |
}, | |
develop: { | |
nodeUpdateInterval: 3000, | |
hardCacheMediaFiles: false, | |
}, | |
production: { | |
hardCacheMediaFiles: false, | |
}, | |
debug: { | |
// these settings are all the defaults, | |
// remove them if you'd like | |
graphql: { | |
showQueryOnError: false, | |
showQueryVarsOnError: true, | |
copyQueryOnError: true, | |
panicOnError: true, | |
// a critical error is a WPGraphQL query that returns an error and no response data. Currently WPGQL will error if we try to access private posts so if this is false it returns a lot of irrelevant errors. | |
onlyReportCriticalErrors: true, | |
}, | |
}, | |
auth: { | |
htaccess: { | |
username: null, | |
password: null, | |
}, | |
}, | |
// fields can be excluded globally. | |
// this example is for wp-graphql-gutenberg. | |
// since we can get block data on the `block` field | |
// we don't need these fields | |
excludeFieldNames: [`blocksJSON`, `saveContent`], | |
type: { | |
Post: { | |
limit: | |
process.env.NODE_ENV === `development` | |
? // Lets just pull 50 posts in development to make it easy on ourselves. | |
50 | |
: // and we don't actually need more than 5000 in production for this particular site | |
5000, | |
}, | |
// this shows how to exclude entire types from the schema | |
// these examples are for wp-graphql-gutenberg | |
CoreParagraphBlockAttributes: { | |
exclude: true, | |
}, | |
CoreParagraphBlockAttributesV2: { | |
exclude: true, | |
}, | |
CorePullquoteBlockAttributes: { | |
exclude: true, | |
}, | |
}, | |
}, | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment