markshapiro / graphql-db-projection Goto Github PK
View Code? Open in Web Editor NEWCreate projection of fields needed to fetch from db from Graphql query. Supports nested queries & custom field names.
License: MIT License
Create projection of fields needed to fetch from db from Graphql query. Supports nested queries & custom field names.
License: MIT License
Thanks for a great project.
My objective is to generate projection for Graphql Queries, containing InlineFragments.
Do you have any suggestions how to support this?
Hello!
first thank you for you work, it saves me a lot of time for my project!
I was wondering, how to parse ASTFields with your lib to get only first level fields (and transform multi level in first level). To be clear this is an example :
this is a request I made in GraphiQL
{
My_item(id: "abcdefghijklmnoqlsnejngwd") {
id
name
function {
subfield1
subfield2
}
}
}
by default I get this with your functions (makeProjection
and toMongoProjection
):
id: 1, name: 1, 'function.subfield1': 1, 'function.subfield2': 1
I would like to have something similar to this:
id: 1, name: 1, 'function: 1
I saw in your documentation that we can do that:
@proj(projections: [])
in our GraphQL schema, so I tried to make it work but this time I don't get my object at all so I can't make any request with its id as you suggest it here :
// but not posts as we explicitly omitted them because they are located in different collection
May be I didn't get something or did something wrong, IDK for the moment.
The only workaround I've found is to do something like:
function: Function @proj(projection: "function")
in my Schema. It not seems to be a clean way to do it..
Do you have any ideas? thanks!
Hello,
Do you have any ideas to handle inline fragments with your library in order to generate projections?
Thanks
Alvyre
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.