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 the word Asset as a model returns an error in version 0.7.6

See original GitHub issue

What happened?

i have the following gql schema:

type Asset @model {
  id: ID
  type: String
  name: String
  collection: String
  data: AssetData
  shares: [AssetShare]
  modifiedOn: String
}

type AssetData {
  contentType: String!
  host: String
  container: String!
  path: String
}

type AssetShare {
  id: String!
  target: String
  host: String
  container: String
  path: String
}

and this worked fine with versions prior to 0.7.6. this version fails with the following response:

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

i have tried putting the plural and singular names in the configuration like this:

"Asset": {
      "source": "models",
      "graphql": {
        "type": {
          "singular": "Asset",
          "plural": "Assets"
        }
      },

but it doesn’t seem to solve it either.

Version

0.7.6 (part of the swa cli)

What database are you using?

CosmosDB NoSQL

What hosting model are you using?

Local (including CLI)

Which API approach are you accessing DAB through?

GraphQL

Relevant log output

[dataApi] fail: Azure.DataApiBuilder.Service.Startup[0]
[dataApi]          at Azure.DataApiBuilder.Service.Services.MetadataProviders.CosmosSqlMetadataProvider.GetEntityName(String graphQLType) in /_/src/Service/Services/MetadataProviders/CosmosSqlMetadataProvider.cs:line 320
[dataApi]          at Azure.DataApiBuilder.Service.Models.GQLFilterParser.Parse(IMiddlewareContext ctx, IInputField filterArgumentSchema, List`1 fields, BaseQueryStructure queryStructure) in /_/src/Service/Models/GraphQLFilterParsers.cs:line 198
[dataApi]          at Azure.DataApiBuilder.Service.Models.GQLFilterParser.ParseAndOr(IMiddlewareContext ctx, IInputField argumentSchema, IInputField filterArgumentSchema, List`1 fields, BaseQueryStructure baseQuery, PredicateOperation op) in /_/src/Service/Models/GraphQLFilterParsers.cs:line 430
[dataApi]          at Azure.DataApiBuilder.Service.Models.GQLFilterParser.Parse(IMiddlewareContext ctx, IInputField filterArgumentSchema, List`1 fields, BaseQueryStructure queryStructure) in /_/src/Service/Models/GraphQLFilterParsers.cs:line 56
[dataApi]          at Azure.DataApiBuilder.Service.Resolvers.CosmosQueryStructure.Init(IDictionary`2 queryParams) in /_/src/Service/Resolvers/CosmosQueryStructure.cs:line 168
[dataApi]          at Azure.DataApiBuilder.Service.Resolvers.CosmosQueryEngine.ExecuteAsync(IMiddlewareContext context, IDictionary`2 parameters) in /_/src/Service/Resolvers/CosmosQueryEngine.cs:line 64
[dataApi]          at Azure.DataApiBuilder.Service.Services.ResolverMiddleware.InvokeAsync(IMiddlewareContext context) in /_/src/Service/Services/ResolverMiddleware.cs:line 95
[dataApi]          at HotChocolate.Utilities.MiddlewareCompiler`1.ExpressionHelper.AwaitTaskHelper(Task task)
[dataApi]          at HotChocolate.Execution.Processing.Tasks.ResolverTask.ExecuteResolverPipelineAsync(CancellationToken cancellationToken)
[dataApi]          at HotChocolate.Execution.Processing.Tasks.ResolverTask.TryExecuteAsync(CancellationToken cancellationToken)

Code of Conduct

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

Issue Analytics

  • State:closed
  • Created 3 months ago
  • Comments:15 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
Aniruddh25commented, Jun 21, 2023

hi @dgcaron, are you using filter while retrieving the list of assets?

Also, does your configuration contain the entities - AssetData and AssetShare? If not, could you please try adding those to the config as well?

0reactions
Aniruddh25commented, Jul 24, 2023

Closing this as this is the intended behavior as per the investigation in the above comment here: https://github.com/Azure/data-api-builder/issues/1538#issuecomment-1630836030

Read more comments on GitHub >

github_iconTop Results From Across the Web

[0.7.6] Latios Framework for ECS megathread | Page 5
People who want to create free assets for the community are heavily incentivized to ... After installing version 0.6.4 many errors appeared
Read more >
Bug listing with status RESOLVED with resolution INVALID as ...
Bug :27 - "Test" status:RESOLVED resolution:INVALID severity:normal ... runs just fine compiled with gcc version 2.95.3" status:RESOLVED resolution:INVALID ...
Read more >
dagster/CHANGES.md at master
Fixed a bug that caused AutoMaterializePolicy.lazy() to not materialize missing assets that were downstream of assets without an AutoMaterializePolicy. In rare ...
Read more >
Changelog — great_expectations documentation
[BUGFIX] Fixed a bug in the error printing logic in several exception handling blocks in the Data Docs rendering. This will make it...
Read more >
build_runner | Dart Package
Fix a serve mode bug which causes an unhandled exception if the build fails to initialize (usually because it is out of date)....
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