Ash FrameworkAF
Ash Framework3y ago
7 replies
Ben RMX

GraphQL :type, prefix based on Context?

In the example docs, we have something like the following:

defmodule Helpdesk.Support.Ticket do
...omitted...
  graphql do
    type :ticket
  end
end


So, the following introspection query would return Ticket as a type.

{
  __schema {
    types {
      name
    }
  }
}


So, given a totally made up hypothetical, if we had another Ash API with a resource Amusement.Parks.Ticket , included in the same Ash GraphQL Schema... wouldn't the two Ticket graphql names clobber each other?

So, is there a way to automatically prefix the resource with a context/api based name? To get graphql like HelpdeskSupportTicket and AmusementParksTicket ?

Or is it up to the application developer to explicitly define type :helpdesk_support_ticket and type :amusement_parks_ticket ?
Was this page helpful?