refine icon indicating copy to clipboard operation
refine copied to clipboard

[FEAT] Graphql - configurable mutation InputType

Open florent-andre opened this issue 2 years ago • 3 comments

Is your feature request related to a problem? Please describe.

In create and update mutation queries, operation name can be configured via metadata. variable.input.type can't be configured as it's "hard coded".

There is case (or at list mine ;)), where InputType.type can't be the same as the "hardcoded by refine" ones.

Describe alternatives you've considered

No response

Additional context

No response

Describe the thing to improve

For example, in the dataProvider.create, and in the same spirit that allow to configure operation :

const operation = metaData?.operation ?? camelCreateName;

The variables.input.type should be something like:

const variableInputType = metaData?.variableInputType ?? `${camelCreateName}Input`

What do you think about that ? Is it doable ? Thanks for this great piece of lib !

florent-andre avatar Jan 16 '23 22:01 florent-andre

Hey @florent-andre

GraphQL data provider needs various arrangements. This includes what you wrote. Can you create PR to support us? 🙏🏼

yildirayunlu avatar Jan 17 '23 07:01 yildirayunlu

Yes, sure I can try (maybe this week or later on). Do you think metaData?.variableInputType is a good name ? Regards

florent-andre avatar Jan 17 '23 07:01 florent-andre

Yes, sure I can try (maybe this week or later on). Do you think metaData?.variableInputType is a good name ? Regards

I think metaData?.variableInputType can be found better, we are open to suggestions. We look forward to PR 🎉

yildirayunlu avatar Jan 18 '23 08:01 yildirayunlu

Hello! I'll open a PR for this one!

mattbho avatar Apr 13 '23 16:04 mattbho