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.

[Bug]: Using filter on multi-level nested objects causes runtime error (GraphQL, CosmosDB)

See original GitHub issue

What happened?

Simplified version of the schema looks like:

type EmployeeAggregate @model {
  id: ID
  Payload: Payload
}

type Payload {
  Id: ID
  Jobs: [Job]
}

type Job {
  Fte: Int
}

Config looks like:

"entities": {
    "EmployeeAggregate": {
      "source": "employeeAggregates_v2",
      "permissions": [
        {
          "role": "anonymous",
          "actions": [
            "*"
          ]
        }
      ]
    },
    "Payload": {
      "source": "employeeAggregates_v2",
      "permissions": [
        {
          "role": "anonymous",
          "actions": [
            "*"
          ]
        }
      ]
    },
    "Job": {
      "source": "employeeAggregates_v2",
      "graphql": {
        "type": {
          "singular": "Job",
          "plural": "Jobs"
        }
      }
	}
}

Query looks like:

    employeeAggregates(first: 10, filter: {Payload: {Jobs: {Fte: {eq: 1}}}}) {
        items {
            Payload {
                Id
            }
        }
    }
}

Error looks like:

{
    "errors": [
        {
            "message": "GraphQL type doesn't match any entity name or singular type in the runtime config.",
            "extensions": {
                "code": "BadRequest"
            }
        }
    ]
}

Note Filtering on first-level nested object (e.g. “Payload”) works. However, filtering second-level nested objects (e.g. “Jobs”) fails.

Version

0.7.6

What database are you using?

CosmosDB NoSQL

What hosting model are you using?

Static Web Apps (SWA)

Which API approach are you accessing DAB through?

GraphQL

Relevant log output

{
    "errors": [
        {
            "message": "GraphQL type doesn't match any entity name or singular type in the runtime config.",
            "extensions": {
                "code": "BadRequest"
            }
        }
    ]
}

Code of Conduct

  • I agree to follow this project’s Code of Conduct

Issue Analytics

  • State:open
  • Created a month ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
sajeetharancommented, Aug 17, 2023

@Isayaa This limitation extends to queries as well. We will assess and provide you with an update regarding the ETA for the fix.

0reactions
Isayaacommented, Aug 17, 2023

@tarazou9 thanks for your answer. Some feedback and question:

  • Your PR only mentions a limitation with mutations. However, in this case we just need to have the queries working. Is it a mistake in the PR description?
  • Do you have any plan in fixing the limitation (for queries)? It’s an important info for us because it would mean we need to consider another technology to expose our existing CosmosDB that contains nested objects up to 3 level.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to queries in nested object in CosmosDB entry
Is there a way to query a nested object within a document in CosmosDB when there are multiple nested items with same id:...
Read more >
CRAN Packages By Name
Available CRAN Packages By Name ; ACSWR, A Companion Package for the Book "A Course in Statistics with R" ; act, Aligned Corpus...
Read more >
An Atypical ASP.NET Core 6 Design Patterns Guide
A SOLID adventure into architectural principles and design patterns using ... NET SDK versus runtime • 9 ... Using multiple configurator objects •...
Read more >
sitemap~www~guided-projects.xml
https://www.coursera.org/projects/how-to-create-a-marketing-analytics-dashboard-using-hubspot ... https://www.coursera.org/projects/qa-java-bugs-and-errors ...
Read more >
Simple Index
564bff00ff-strawberry-graphql ... add-methods-and-properties-to-existing-object ... amazon-product-scraper-with-python · amazon-review-scraper
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