Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error 'Could not load type ‘Marten.Linq.IMartenQueryable’ from assembly' when using filtering with Marten #7132

Open
michirem opened this issue May 29, 2024 · 0 comments
Labels
🐛 bug Something isn't working 🌶️ hot chocolate

Comments

@michirem
Copy link

Product

Hot Chocolate

Version

13.9.5

Link to minimal reproduction

https://github.com/michirem/hotchocolate-examples

Steps to reproduce

Using this query

query books {
  books(where: { id: { eq: "5be76eb2-5e85-41d0-b770-ea1d83f9bbb0" } }) {
    content
    id
    isPopular
  }
}

What is expected?

{
  "data": {
    "books": [
      {
        "content": "695f640e-782a-4773-853e-3954fcd4d5e8",
        "id": "5be76eb2-5e85-41d0-b770-ea1d83f9bbb0",
        "isPopular": false
      }
    ]
  }
}

What is actually happening?

The following error response

{
  "errors": [
    {
      "message": "Unexpected Execution Error",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "books"
      ],
      "extensions": {
        "message": "Could not load type 'Marten.Linq.IMartenQueryable' from assembly 'Marten, Version=7.16.0.0, Culture=neutral, PublicKeyToken=null'.",
        "stackTrace": "   at HotChocolate.Data.Marten.Filtering.MartenQueryableFilterProvider.IsInMemoryQuery[TEntityType](Object input)\n   at HotChocolate.Data.Filters.Expressions.QueryableFilterProvider.<>c__DisplayClass15_0`1.<CreateApplicator>b__0(IResolverContext context, Object input)\n   at HotChocolate.Data.Filters.Expressions.QueryableFilterProvider.<>c__DisplayClass10_0`1.<<CreateExecutor>g__ExecuteAsync|1>d.MoveNext()\n--- End of stack trace from previous location ---\n   at HotChocolate.Execution.Processing.Tasks.ResolverTask.ExecuteResolverPipelineAsync(CancellationToken cancellationToken)\n   at HotChocolate.Execution.Processing.Tasks.ResolverTask.TryExecuteAsync(CancellationToken cancellationToken)"
      }
    }
  ],
  "data": null
}

Relevant log output

Could not load type 'Marten.Linq.IMartenQueryable' from assembly 'Marten, Version=7.16.0.0, Culture=neutral, PublicKeyToken=null'
   at HotChocolate.Data.Marten.Filtering.MartenQueryableFilterProvider.IsInMemoryQuery[TEntityType](Object input)\n   at HotChocolate.Data.Filters.Expressions.QueryableFilterProvider.<>c__DisplayClass15_0`1.<CreateApplicator>b__0(IResolverContext context, Object input)\n   at HotChocolate.Data.Filters.Expressions.QueryableFilterProvider.<>c__DisplayClass10_0`1.<<CreateExecutor>g__ExecuteAsync|1>d.MoveNext()\n--- End of stack trace from previous location ---\n   at HotChocolate.Execution.Processing.Tasks.ResolverTask.ExecuteResolverPipelineAsync(CancellationToken cancellationToken)\n   at HotChocolate.Execution.Processing.Tasks.ResolverTask.TryExecuteAsync(CancellationToken cancellationToken)

Additional context

<Project Sdk="Microsoft.NET.Sdk.Web">

    <PropertyGroup>
        <TargetFramework>net8.0</TargetFramework>
        <Nullable>enable</Nullable>
        <ImplicitUsings>enable</ImplicitUsings>
    </PropertyGroup>

    <ItemGroup>
      <PackageReference Include="HotChocolate.AspNetCore" Version="13.9.5" />
      <PackageReference Include="HotChocolate.Data" Version="13.9.5" />
      <PackageReference Include="HotChocolate.Data.Marten" Version="13.9.5" />
      <PackageReference Include="Marten" Version="7.16.0" />
    </ItemGroup>

</Project>
@michirem michirem added the 🐛 bug Something isn't working label May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 🌶️ hot chocolate
Projects
None yet
Development

No branches or pull requests

1 participant