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

fix(LocalGraphQLClient): handle middleware and responseReducer #1206

Merged

Conversation

G100g
Copy link
Contributor

@G100g G100g commented Jul 9, 2024

What does this PR do?

Let LocalGraphQLClient to handle middlewareand responseReducer

Related issues

resolve #1196

Checklist

  • I have checked the contributing document
  • I have added or updated any relevant documentation
  • I have added or updated any relevant tests

@G100g G100g force-pushed the handle-middleware-and-responsereducer-localgraphqlclient branch from 53f6da1 to df93b51 Compare July 9, 2024 15:19
Copy link

@bilalshareef bilalshareef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

const { data, errors } = collectErrorsFromObject(result)
if (errors.length > 0) {
const { data, errors } = collectErrors(result)
if (errors && errors.length > 0) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: This line can be if (errors?.length > 0) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback.
I tried to use it before push the code, but I got this error from TS

image

So I preferred to stay with this version :D

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh okay. The current code looks good to me then. 🙂

@simoneb simoneb merged commit 95219cd into master Jul 22, 2024
5 checks passed
@simoneb simoneb deleted the handle-middleware-and-responsereducer-localgraphqlclient branch July 22, 2024 08:05
@github-actions github-actions bot mentioned this pull request Jul 22, 2024
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.

using LocalGraphQLClient with passing localQueries for test purposes is not calling the middleware functions
3 participants