问题
I am new to GatsbyJs - GraphQL, I have been exploring the example provided by gatsby(https://github.com/gatsbyjs/gatsby/tree/master/examples/using-gatsby-source-graphql), As I tried with local apollo-grapql server, It returns data in the front-end, However it throws above error and blocks the build process, not sure what exactly is typeName I need to pass it in here? any help one this would be much appreciated.
`gatsby-source-graphql`,
{
resolve: "gatsby-source-graphql",
options: {
// This type will contain remote schema Query type
typeName: "Query",
// This is field under which it's accessible
fieldName: "blah",
// Url to query from
url: "http://10.113.34.59:4000/graphql",
// this is URL where served exposed its service in local
},
回答1:
`gatsby-source-graphql`, <==== this caused the issue
{
resolve: "gatsby-source-graphql",
options: {
// This type will contain remote schema Query type
typeName: "Query",
// This is field under which it's accessible
fieldName: "blah",
// Url to query from
url: "http://10.113.34.59:4000/graphql",
// this is URL where served exposed its service in local
},
Below worked fine
{
resolve: "gatsby-source-graphql",
options: {
// This type will contain remote schema Query type
typeName: "Query",
// This is field under which it's accessible
fieldName: "blah",
// Url to query from
url: "http://10.113.34.59:4000/graphql",
// this is URL where served exposed its service in local
},
来源:https://stackoverflow.com/questions/55355700/error-invariant-violation-gatsby-source-graphql-requires-option-typename-to