How can I exclude non-matching records from a graphql using the gql library in python?

115 views Asked by At

I am running a query against a graphql server, but the query is returning more records than can be handled and the query is timing out. I can't figure out how to get pagination to work properly, but really I only need a subset of all of the records where the language field matches 'english', but I can't figure out how to do this.

query DocumentsAndSoftware 
   {
   technicalDocumentsEntries (limit: 3000) 
      {
      ... on technicalDocuments_document_Entry 
         { id title technicalDocuments { 
         ... on technicalDocuments_document_BlockType 
             { fallbackFileUrl documentLanguage file 
                { id url dateModified
                }
             }
         }
      }
   }

I have tried this

query 
    languages($documentLanguage: {DocumentsAndSoftware: 
    {technicalDocuments_document_Entry {technicalDocuments: 
    {technicalDocuments_document_BlockType: {some: {documentLanguage: 
     {eq:'english'}}}}}}}) 

To prepend the query

But I am getting this error:

GraphQLSyntaxError: Syntax Error: Expected Name, found '{'.

GraphQL request:1:36
1 | query languages($documentLanguage: {DocumentsAndSoftware: {technicalDocuments_do
  |                                    ^
  | cument_Entry {technicalDocuments: {technicalDocuments_document_BlockType: {some:

I don't really understand the logic around how this querying/filtering works here. I understand that I'm trying to find records where the documentLanguage field matches the term 'english', and I think I've specified the path for that match, but the error doesn't make any sense to me. Can someone help me out?

Thanks

0

There are 0 answers