0

We've created a server Apollo Server which recover datas for various sources and allow to do proper queries in graphQL to recover theses datas. For a specific content, to have the full content, the GraphQL query is very huge and complicated to have the full content and the content continue to involve, so the query should follow. Like we need to have the full content, frontend would like to do a simple query which will not specify fields but return the entire content like something:

{
  BigContent(id: 'test')
}

The goal is to have a query which always return the full content without update the query but we haven't find anything for that and we suppose it's opposite to the philosophy of graphQL.

Claire D
  • 143
  • 1
  • 7
  • So you basically want the equivalent of `select * from table`? – Reinstate Monica Cellio Oct 30 '19 at 17:38
  • Exactly, but for GraphQL. – Claire D Oct 30 '19 at 17:38
  • AFAIK that isn't something that is available, and that's by design. I've not used it myself for a while but it wasn't available then, and I have no reason to believe it's available now. Have a read of this link, where someone asks the same question and gets given a working solution. I say "working", but it does require a small amount of maintenance on your part, but only a small amount... https://www.prisma.io/forum/t/include-all-fields-of-a-type-in-a-graphql-query/352 – Reinstate Monica Cellio Oct 30 '19 at 17:40
  • GraphQL doesn't support any syntax for getting all the fields. There's two practical reasons for this: 1) fields may have arguments, some of which may be non-null (required) and 2) fields may be recursive. A GraphQL field is not equivalent to a row in a database. – Daniel Rearden Oct 30 '19 at 18:37

0 Answers0