I am querying a field which returns a list of Cont...
# apollo-kotlin
s
I am querying a field which returns a list of Contract like
[Contract!]!
. In my case, I actually am only interested in the size of that list for this particular situation. Because I just wanna know if there are any contracts. Then on my .graphql file, I got this
Copy code
...
  activeContracts {
    id
  }
...
but I am getting
unused field
on the id, since well... I am not in fact using it 😄 There's no notion of just fetching a list without anything in there in GQL right? Is my best bet to just add
# noinspection ApolloUnusedField
over the
id
to not get a warning?
m
There's no notion of just fetching a list without anything in there in GQL right?
Indeed there needs to be a selection.
I guess the idiomatic way would be to return something like a
Connection
or so where you have the list size as page metadata
Otherwise
# noinspection ApolloUnusedField
indeed
s
Right, we do not have pagination basically anywhere in our entire schema so noinspection it is for us. Thanks 🙏
👍 1
e
tried
__typename
?
s
Yeah, that could work too, the IDE plugin is still letting me know that I am not using it, so in the end I suppose it does not entirely matter. At least __typename I know for sure I won't be trying to use from the code though