Hello
On my GQL server, we have various model objects, let’s call them Foo
and Bar
. Both foo and bar have a field called tags which resolve to the same server side Tags model.
So in theory, I can make queries like
foo (or) bar
{
fooOrBarSpecificFields go here...
tags
{
id
name,
created
modified
owner
{
id
}
}
}
Thats fine, but I also want to make a fragment on tags:
fragment myTagFragment on Tag
{
id
name,
created
modified
owner
{
id
}
}
and now my queries for Foo and Bar become:
foo (or) bar
{
fooOrBarSpecificFields go here...
tags
{
... myTagFragment
}
}
This in theory should work, and does in the servers GraphiQLConsole, but when I compile using ./apollo-ios-cli generate
I get errors like
- TypeNameConflict: Field 'tag' conflicts with field 'tag' in GraphQL definition `Foo.TaggedItem`.
Is there a mechanism to have common fragments resolve to their own to level name space which could then be shared across objects that have the shared fields? In my actual non trivial use case the Tag is shared across many model objects, and having access to a single fragment model would be very very helpful.
Thank you for any insight!