Skip to content

Nested queries and mutations #71

@joshprice

Description

@joshprice
Contributor

Is your feature request related to a problem? Please describe.

Currently the ash graphql extension puts all queries and mutations in the Query or Mutation Root (the top level).

This prevents us from exposing 2 mutations of the same name. Also with many queries or mutations it gets harder to navigate the docs and find the one you want in graphql docs.

Describe the solution you'd like

In GraphQL you can nest queries and mutations in types like a grouping structure like so:

query {
  group {
    queryA {
      id
    }
  }
}

The ability to easily make use of such a technique in ash_graphql would be useful. Could look like this but open to suggestions on what to call the nesting eg group:

graphql do
  type :resource
  
  query do
     group :group_name do
        list :resources
      end
    end
  end
end

Additional context

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @joshprice@zachdaniel

        Issue actions

          Nested queries and mutations · Issue #71 · ash-project/ash_graphql