Skip to content

Make the object_type_name available in async_graphql::context::SelectionField #546

Description

@lastmjs

Currently async_graphql::context::SelectionField will give you access to the field name, alias, arguments, and child fields through the selection_set. This all works very well, and I am able to return arbitrarily complex selection sets for my project Sudograph. Sudograph is a GraphQL database for the Internet Computer, it is designed in a particular way probably not common to how GraphQL is normally used with traditional databases like Postgres/MySQL/MongoDB. I just bring this up in case you're questioning why I need this functionality.

I am missing a key part of the selection set, which is the object type from the schema that the current selection set or field belongs to. I need this information to implement searching/filtering on relations within a selection set, and without it being available to me in async_graphql::context::SelectionField I believe I am going to have to get the SDL from the schema, parse it into an AST, and manually walk it to find the object types that I need. I think this will work fine, but it will be a lot of extra work and processing when a simple object_type_name method available on async_graphql::context::SelectionField would save me all of that trouble.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions