question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error Running sample GraphQL query on Books with Authors

See original GitHub issue

Hello, I was re-testing the Cosmos Starter doc GraphQL queries (dab updated to latest 0.2.52 version) based on https://github.com/Azure/data-api-builder/blob/main/docs/getting-started/getting-started-azure-cosmos-db.md#graphql-operations-on-entity-relationships and found that while simple GraphQL query on single entity worked fine, query on multiple entity/types from that Doc example (Books and Authors) failed with Type error - See below.

 {
    "errors": [
        {
            "message": "The field `authors` does not exist on the type `Book`.",
            "locations": [
                {
                    "line": 7,
                    "column": 7
                }
            ],
            "path": [
                "books",
                "items"
            ],
            "extensions": {
                "type": "Book",
                "field": "authors",
                "responseName": "authors",
                "specifiedBy": "http://spec.graphql.org/October2021/#sec-Field-Selections-on-Objects-Interfaces-and-Unions-Types"
            }
        }
    ]
} 

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

0reactions
sajeetharancommented, Oct 17, 2022

@Aniruddh25 That results in type error, Looks like this is a bug, let me check with @mbhaskar

Read more comments on GitHub >

github_iconTop Results From Across the Web

GraphQL query best practices
The first query is named GetBooks . The second query is anonymous. You should define a name for every GraphQL operation in your...
Read more >
GraphQL request error - Unknown argument 'slug'
I am running into this GraphQL error while compiling: error GraphQL Error There was an error while compiling your site's GraphQL queries.
Read more >
Failed to validate the query: `Field does not exist on ...
Attempting to create a book yields a similar error. My Cell for FindBooks looks like this: export const QUERY = gql` query FindBooks...
Read more >
Understanding N + 1 Graphql Query Problem
In the example server, the client is able to request a list of books or list of authors without any other information. In...
Read more >
How to Write GraphQL Queries
For example, GitHub's search query takes a searchType argument that is an enum with the possible values of ISSUE , REPOSITORY or USER...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found