Skip to content

Fields decorator to inject parsed AST info #10

Open
@MichalLytek

Description

@MichalLytek

Some people instead of batching and caching separate resolvers (#51) prefer to load all the data manually. So when they resolve the query, they parse the resolve info object to get a list/structure of fields to fetch from DB or API and then create specific query to DB/API.

Also it might be useful for selecting fields/columns from DB, e.g. when the GraphQL query requires only a single field but our database SQL query has to be universal so it has * so it returns a lot of unnecessary data, like other 30 columns/fields.

It would be nice to have a decorator for that with nice integration with graphql-fields. It should convert the returned object to a mongo-like convention (robrichard/graphql-fields#5) and have an ability to return array of keys in first level (without nesting) for sql queries optimization.

It should also take care about mapping the GraphQL field names (provided with { name: "fieldName" } option) to the TS property names.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions