graphql-relay-js icon indicating copy to clipboard operation
graphql-relay-js copied to clipboard

improve mutationWithClientId types with generics

Open noghartt opened this issue 2 years ago • 3 comments
trafficstars

noghartt avatar Dec 05 '22 20:12 noghartt

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: noghartt / name: Guilherme (7dac92b06f719b5ba3745385a647a3a662fc5c80)

@IvanGoncharov can we land this?

saihaj avatar Dec 05 '22 21:12 saihaj

I would like to type inputFields and outputFields too, but I couldn't find a better way than put something like:

  inputFields: Record<keyof TInput, (() => GraphQLInputFieldConfig) | GraphQLInputFieldConfig>;
  outputFields: Record<keyof TOutput, (() => GraphQLFieldConfig<TOutput, TContext>) | GraphQLFieldConfig<TOutput, TContext>>;

In this case, we override ThunkObjMap util type. Would have a better way to do it?

noghartt avatar Dec 05 '22 22:12 noghartt

@graphql/tsc I don't think this project explicitly has a maintainer right now, and other than @andimarek merging a link fix recently hasn't had any updates since 2021. It looks like the overhead of maintaining it should be relatively minor, but in the mean time I move that we merge and ship this PR. I have no experience with this library, but the changes are small and they appear to be non-breaking since all the generics added have defaults. Does anyone have any concerns about this? I'm going to leave it a month (since it's already been over a year) for feedback, and if there's no concerns raised I'll go ahead and merge it after then.

benjie avatar Mar 21 '24 18:03 benjie