We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
nodes
Hot Chocolate
14.0.0
https://github.com/ChauThan/bug-report/tree/main/hotchocolate/globalobjectidentification
node
AdditionalData
{ node(id: "QXV0aG9yOjE=") { id ... on Author { AdditionalData } } }
Data returns correctly.
{ "data": { "node": { "id": "QXV0aG9yOjE=", "AdditionalData": "This is the additional data of Author 1" } } }
query { nodes(ids: ["QXV0aG9yOjE="]) { id ... on Author { AdditionalData id name } } }
{ "data": { "nodes": [ { "id": "QXV0aG9yOjE=", "AdditionalData": "Data not found.", "name": "Author 1" } ] } }
Data of nodes returns same as node
I am using ScopeContextData to resolve this field..
public class AuthorType : ObjectType<Author> { protected override void Configure(IObjectTypeDescriptor<Author> descriptor) { descriptor.ImplementsNode() .IdField(s => s.Id) .ResolveNode((ctx, id) => { var author = ctx.Services.GetRequiredService<AuthorRepository>().GetAuthorById(id); ctx.SetScopedState("AdditionalData", "This is the additional data of " + author?.Name); return Task.FromResult(author); }); descriptor.Field("AdditionalData") .Type<StringType>() .Resolve<string>(ctx => ctx.ScopedContextData.TryGetValue("AdditionalData", out var scopedContextData) ? scopedContextData.ToString() : "Data not found."); } }
It appears all ScopedContextData is cleared in nodes
ScopedContextData
No response
The text was updated successfully, but these errors were encountered:
glen-84
No branches or pull requests
Product
Hot Chocolate
Version
14.0.0
Link to minimal reproduction
https://github.com/ChauThan/bug-report/tree/main/hotchocolate/globalobjectidentification
Steps to reproduce
node
to getAdditionalData
Data returns correctly.
nodes
with same id to getAdditionalData
What is expected?
Data of
nodes
returns same asnode
What is actually happening?
I am using ScopeContextData to resolve this field..
It appears all
ScopedContextData
is cleared innodes
Relevant log output
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: