sarkistlt / mongoose-schema-to-graphql

Use Mongoose schema to generate graphQL type.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Grapiql example

anoopsinghbayes opened this issue · comments

Great work.
can you provide an example how can we expose these graphql types through graphiql so that it can be consumed by the UI

Hi, thanks! What kind of example would you like to see? Because with graphiql it will be exactly the same API like created directly with GraphQL types like here, so the ways to iterate with UI will be exactly the same as well.

Ok this is what i understood after going through your code

  1. one has to write there own resolvers to actually fetch the data through mongoose.(This is what i mean by example in graphiql where you actually fetch the data from mongoose model's).
  2. The Generated Schema does not defines the arguments(Check the arguments part.) which it can accept to make the actual queries ,the "select" part in the query.

correct me if i am wrong.

Got it, link above wasn't example of how to use this module it was just example of graphQL API.

Here the simple example pure graphQL without feathersjs (as on link above).

We are basically using mongose methodes for resolvers, pretty common approach.