Open skunkwerk opened 5 years ago
Gridsome only supports queries for external GraphQL schemas, unfortunately. Mutations should probably be sent to the original endpoint instead because there is no connection to the external schema when the site is built for production :)
thanks @hjvedvik, how would I send mutations to the "original endpoint"? I've setup my GraphQL config like this:
plugins: [ { use: '@gridsome/source-graphql', options: { url: 'http://myapp.com:8080/v1/graphql', fieldName: 'db', headers: {}, }, }
You would need to send requests to your GraphQL endpoint from your pages. You can use a package like Vue Apollo or Axios if you just want to send simple requests.
Summary
It's not clear how to insert data (a GraphQL mutation) when using the source-graphql plugin. The documentation only covers queries and the data API mentions collections & content types - I have no idea what those are.
Brief explanation of the feature.
Basic example
I have an existing GraphQL server, and I just want to insert a row of data!
Include a basic example or links here.
Motivation
To be able to write data to a database.
thanks