graphql-go / graphql-go/graphql

Modifying context in resolver

Open
#500 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
10.1k
Forks
845
PR merge metrics
No merged PRs in 30d

Description

I am currently trying to set additional in context from parent resolver to children. I found this solution: https://github.com/graphql-go/graphql/issues/345 where it was suggested to use RootObject. The problem is that I am also trying to use dataloaders. And currently `GetBatchFn` only accepts context and keys and not `graphql.ResolveParams`. I feel like two ways around could be:
1. To embed value that I need into keys
2. Have reference to RootObject inside context
But this solutions feel very clunky. Am I missing something? Is there more elegant way of doing it?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.