My AshGraphql journey
I'm trying to integrate Ash into an existing Phoenix project. I can see amazing work has been put into this project. Even so, my journey so far has been painful.
I needed to design a GraphQL query that returns a list of things. They first question that arose was: What does the GraphQL query look like for a given Ash GraphQL query definition? Let's say I want to define a query that returns a list of tickets (as from the documentation example). So see in the Ash GraphQL Getting Started page, I can define a query like this:
A reasonable guess is that this generates a GraphQL query called
Now, what if I need the
To be continued in the comments...
I needed to design a GraphQL query that returns a list of things. They first question that arose was: What does the GraphQL query look like for a given Ash GraphQL query definition? Let's say I want to define a query that returns a list of tickets (as from the documentation example). So see in the Ash GraphQL Getting Started page, I can define a query like this:
A reasonable guess is that this generates a GraphQL query called
list_tickets. And writing a test for it shows that in fact, it does. I know that in GraphQL, the successful response JSON will include a key list_tickets that contains the array of tickets. Ok so far, but it would be helpful to see an example of the GraphQL query, so that I can be confident, and not assume.Now, what if I need the
list_tickets query to take a few query parameters? Where in the documentation does it give me information to make that happen? Looking at the example above again, what does the :read argument mean? I see above it in the example, there is another query, read_one :most_important_ticket, :most_important, and the second argument is :most_important. What does this mean? To be continued in the comments...
