Skip to content

Propagate defaults to operation callback #45

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

Merged
merged 1 commit into from
Feb 1, 2022
Merged

Conversation

no1seman
Copy link

@no1seman no1seman commented Jan 27, 2022

Before this PR there is no fast and convenient way to get
operation and directives defaults set when creating the schema.

Now it's possible, operation and directives default can be easily found
is in the #3 argument of callback - map "info". The keys are:

defaultValues - for operation defaults
directivesDefaultValues - for directives defaults

There will be no defaults propageted by default. To make it available must set 2 options:

schema.create(config, name, {defaultValues = true, directivesDefaultValues = true})

This will done to make schema creation a little be faster when one don't need defaults to be propagated.

closes: #37

Copy link
Member

@DifferentialOrange DifferentialOrange left a comment

Choose a reason for hiding this comment

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

Seems ok. As always, thank you for your PR! You'll need to rebase on master and fix possible conflicts with #44 before merge

Copy link
Member

@Totktonada Totktonada left a comment

Choose a reason for hiding this comment

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

The idea is okay. Unlikely I can add something by digging into the code, so I'll approve.

Before this PR there is no fast and convenient way to get
operation and directives defaults set when creating the schema.

Now it's possible, operation and directives default can be easily found
is in the #3 argument of callback - map "info". The keys are:

defaultValues - for operation defaults
directivesDefaultValues - for directives defaults
@Totktonada Totktonada merged commit 17b642d into master Feb 1, 2022
@Totktonada Totktonada deleted the propagate_defaults branch February 1, 2022 05:45
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.

Process defaultValues in inputObject
3 participants