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: fix output type for mutate and get payload #394

Merged
merged 1 commit into from
Jul 11, 2024

Conversation

Eckzzo
Copy link
Contributor

@Eckzzo Eckzzo commented Apr 25, 2024

No description provided.

Copy link

linux-foundation-easycla bot commented Apr 25, 2024

CLA Signed


The committers listed above are authorized under a signed CLA.

Copy link
Contributor

@noghartt noghartt left a comment

Choose a reason for hiding this comment

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

LGTM!

@Eckzzo
Copy link
Contributor Author

Eckzzo commented Jul 10, 2024

@benjie would it be possible for you to take a look?

@sibelius
Copy link
Contributor

this is breaking for everybody

Copy link
Member

@benjie benjie left a comment

Choose a reason for hiding this comment

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

I'm unfamiliar with this code, however I note from the description:

* mutateAndGetPayload will receive an Object with a key for each
* input field, and it should return an Object with a key for each
* output field. It may return synchronously, or return a Promise.

Currently the type doesn't allow for a promise, so if this is permitted as the comment implies then the types should allow for it.

I'm unsure what the knock-on consequences of this change will be, and if it needs a semver major release.

@sibelius
Copy link
Contributor

I would go with a patch or minor

Won’t break for existing use cases

@noghartt
Copy link
Contributor

I'm unfamiliar with this code, however I note from the description:

  • mutateAndGetPayload will receive an Object with a key for each
  • input field, and it should return an Object with a key for each
  • output field. It may return synchronously, or return a Promise.

Currently the type doesn't allow for a promise, so if this is permitted as the comment implies then the types should allow for it.

I'm unsure what the knock-on consequences of this change will be, and if it needs a semver major release.

In case, I would say that doesn't have any side implication of this type definition. It just allows us to handle the mutateAndGetPayload in two ways:

1:

mutateAndGetPayload: () => {
  // ...
}

2:

mutateAndGetPayload: async () => {
  // ...
}

Which is already allowed before, but by the PR we're inserted the generic types, have been strictly removed.

@benjie
Copy link
Member

benjie commented Jul 11, 2024

Ah #389 broke it! Thanks for the info on that @noghartt I can see this is clearly a fix now 👍

@benjie benjie merged commit 8285ab2 into graphql:main Jul 11, 2024
1 check passed
@benjie
Copy link
Member

benjie commented Jul 11, 2024

I've published this as graphql-relay@0.10.2; please can someone confirm that it works correctly and if so I will update the tag from @next to @latest. Thanks!

@benjie benjie added the PR: bug fix 🐞 requires increase of "patch" version number label Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: bug fix 🐞 requires increase of "patch" version number
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants