Graphback: Create MongoDB DB layer on top of runtime

Created on 12 Feb 2020  路  9Comments  路  Source: aerogear/graphback

Currently graphback supports only knex based databases. We should create community supported mongo version

help wanted good first issue

All 9 comments

Do I need need to create an alternative file for KnexDBDataProvider

@udith-shalinda Yes. That will be the way forward. We can implement it in the same package for now for simplicity

@wtrocki Anyway I have created a separate file. I had to pass mongoose models from resolvers and return context.crudService.findBy("note", args.fields); will be changed to return context.crudService.findBy(MongooseModel, args.fields);

Can you give me a reference where I can find how to generate mongoose model?

Why not use mongo driver directly? Using mongose in this context makes less sense. Also please make sure you use latest changes on master. Current crud interface looks different

I have published new docs that explain the changes on master. Things will be much easier to integrate now - even when using mongoose

Now I'm using mongo driver instead of mongoose.

With the new version,I'm little bit confused about how you manage table name in curdservice

@udith-shalinda Mapping abstraction brings some complexity as people can specify different collection name on their model. Something like

""" db.name: custom_name """

We do not need to care about enabling this for mongo.
I guess for the initial version you can use the original name from the type or something like graphqlType.name.toLowerCase()

FYI @craicoverflow

Thanks to awesome contribution to @udith-shalinda we have now mongo supported (relationships/batching will land soon as well)

Was this page helpful?
0 / 5 - 0 ratings