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

[HotChocolate.Data.UseFirstOrDefault] causes an exception: EXEC_LIST_TYPE_NOT_SUPPORTED #2559

Closed
arminneman opened this issue Nov 10, 2020 · 0 comments · Fixed by #2562
Closed
Assignees
Labels
🔍 investigate Indicates that an issue or pull request needs more information.

Comments

@arminneman
Copy link

arminneman commented Nov 10, 2020

[HotChocolate.Types.UseFirstOrDefault] has been moved to [HotChocolate.Data.UseFirstOrDefault] in v11(rc0 and rc1), but the latter gives an exception: EXEC_LIST_TYPE_NOT_SUPPORTED
The type '...' is not supported as list value.

The [UseFirstOrDefault] attribute should automatically set the return type as instead of IEnumerable

To Reproduce
Steps to reproduce the behavior:
server side:
[HotChocolate.Data.UseFirstOrDefault]
[HotChocolate.Data.UseProjection]
[HotChocolate.Data.UseFiltering]
public IQueryable GetUserGroupById([Service] EherkenningDataContext context, Guid id) =>
context.UserGroups.Where(p => p.GroupId == id);

client side:
query {
userGroupById (id: "e003c8c1-3310-4a58-9baf-08d880a18656") {
groupId
}
}

same behaviour occurs with SingleOrDefault

Expected behavior
It should return a single result

Work around
provided by Pascal, add:

[GraphQLType(typeof(ObjectType))]

@PascalSenn PascalSenn self-assigned this Nov 10, 2020
@PascalSenn PascalSenn added 🌶 hot chocolate 🔍 investigate Indicates that an issue or pull request needs more information. labels Nov 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔍 investigate Indicates that an issue or pull request needs more information.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants