Is there a way to implement graphql cursor based pagination with nested pagination queries in a performant way? Let’s say we have 3 pseudo graphql types: For simplicity let’s say user could read thousands of books and each book can have hundred of pages. user database table: book database table: page database table: user_book database table: book_page database table: We
Tag: graphql
Hasura Graphql does not return all documents when multiple foreign keys exist in a table to the same foreign field
Query: Response: Expected: Why are the last two documents not showing up from the first query? Connection table definition: I know this could be more of a SQL question, but it would be great if you can show the graphql version too Answer You have to create two relationships between users table and connections table, Then query : Output:
Hasura GraphQL query : where clause with value from related entity
I recently started using GraphQL through a Hasura layer on top of a PostgreSQL DB. I am having troubles implementing a basic query. Here are my entities : article : articleId content publishedDate categoryId category : categoryId name createdDate What I am trying to achieve, in English, is the following : get the articles that were published in the first
Optional variable in Graphql
I have a graphql query like this: when i run this it expects a id as variable. How can I make that variable optional? It should display all results when no id is given Answer There’s no way that I’m aware to declare a variable as optional but also have it ignore the rest of the expression in the way
Graphql, node.js and sql,Cannot return null for non-nullable field
I want to return data coming from db to the api. The data is being logged but not showing on the graphql api. RESULT: OUTPUT: Answer This is your resolver: A GraphQL resolver must return either a value or a Promise that will resolve to a value. However, here, you’re not returning either. Keep in mind that callbacks are invoked