KevinGrandon / fusion-boilerplate

Boilerplate applications written in FusionJS
https://fusionjs.com/docs/getting-started/create-a-project#example-fusionjs-projects
32 stars 17 forks source link

Local GraphQL server example #43

Closed ratson closed 5 years ago

ratson commented 5 years ago

I am trying out fusion, but stuck in implementing Mutation (http://localhost:3000/counter), and cannot find any documentation about it, it would be helpful if there is an example on how to do it.

KevinGrandon commented 5 years ago

Great ideas around docs, we could definitely use more of them. What error are you getting when using Mutation?

For my own cases, I have been importing mutation with gql from fusion-apollo. I will then typically compose my componennt with the graphql function from react-apollo, which populates the mutation as a property.

ratson commented 5 years ago

Thank you for the prompt reply.

I got POST body missing. Did you forget use body-parser middleware? error when calling the mutation, the related code in https://github.com/ratson/fusion-apollo-material-ui-boilerplate/blob/master/src/pages/counter.js and https://github.com/ratson/fusion-apollo-material-ui-boilerplate/blob/master/src/main.js#L65

KevinGrandon commented 5 years ago

Thanks for the details, that's helpful. Most likely this is some issue with the local graphql server and https://github.com/fusionjs/fusion-plugin-apollo-server/issues/53. So far, I think folks have only been doing queries (GET), and not mutations (POST). We'll look into addressing that for you. We have a slowdown for the winter holidays, but will try to get to this when we can.

KevinGrandon commented 5 years ago

Let's close and track in https://github.com/fusionjs/fusion-plugin-apollo-server/issues/53 for now.