Mean.io graphql don't allow me to insert new record in a new schema

90 views Asked by At

I am just a newbie in mean.io . I want to build an event module just like the post which can be found the default module when you make an installation. I have taken everything from the post and renamed it as event. Now when I am trying to insert a new record in the event schema its showing an error like

there was an error sending the query Error: GraphQL error: Unknown type "EventInput". Did you mean "PostInput"?
GraphQL error: Cannot query field "addEvent" on type "Mutation". Did you mean "addPost"?

So can someone tell me what I am doing wrong here? Any suggestion or help will be really appreciable.

1

There are 1 answers

0
Mouli Krishna reddy potha On

The problem is with innograph. The addPost is coming from this npm module and not the actual /server/ changes that you have made.

innograph is initialised in express.js

  1. The solution is to copy the innograph code into you application. Make all the changes and actually remove innograph from package.json.
  2. If its too much just remove innograph, graphql, apollo packages and then simply use express.js that is also pre-built into mean.io.

The second step requires changes to be made into /server/ folder. I had to do some debugging to actually make it work.