Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested queries and mutations #71

Open
joshprice opened this issue May 4, 2023 · 0 comments
Open

Nested queries and mutations #71

joshprice opened this issue May 4, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@joshprice
Copy link
Contributor

joshprice commented May 4, 2023

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

@joshprice joshprice added the enhancement New feature or request label May 4, 2023
@zachdaniel zachdaniel added the good first issue Good for newcomers label Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants