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

feat(ferry_exec): Pass context to GQL Links #576

Merged
merged 2 commits into from
Feb 3, 2024

Conversation

tpucci
Copy link
Contributor

@tpucci tpucci commented Feb 3, 2024

  • feat: pass context to gql links
  • feat: update generated code

Generated code was updated with "void" statements. I am not sure why

Feature request: #575

In order to create advanced Links that can execute custom logic per request, we need a way to extend request with ContextEntries.

Currently, generated code for a request is:

  @override
  Request get execRequest => Request(
    operation: operation,
    variables: vars.toJson(),
    // no passed context. Thus, the default is `context = const Context()`
  );

gql_exec has a method .withContextEntry on Operation that we could use.

I'd be happy to contribute if you think it is a good issue 🙂

(😅 Hope I did not miss something in the API that already allows us to create context entries) Reference: #556

Copy link

netlify bot commented Feb 3, 2024

Deploy Preview for verdant-brigadeiros-5171fa canceled.

Name Link
🔨 Latest commit 04ddd30
🔍 Latest deploy log https://app.netlify.com/sites/verdant-brigadeiros-5171fa/deploys/65be35bd023cc30009b948d9

@tpucci
Copy link
Contributor Author

tpucci commented Feb 3, 2024

I'd be happy to fix verify_commits but I did not understand why it failed

@knaeckeKami knaeckeKami changed the title Pass context to GQL Links feat(ferry_exec): Pass context to GQL Links Feb 3, 2024
@knaeckeKami
Copy link
Collaborator

It was the name of the PR. edited it for you and reran the action :)

(this is so CHANGELOGs can be created automatically with melos)

@knaeckeKami
Copy link
Collaborator

LGTM!

@knaeckeKami knaeckeKami merged commit 850e915 into gql-dart:master Feb 3, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants