Skip to content

Fix describing type with table in schema #31

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 2 commits into from
Dec 14, 2021

Conversation

DifferentialOrange
Copy link
Member

@DifferentialOrange DifferentialOrange commented Dec 1, 2021

Rework of #22

Before this PR, describing argument type in schema with a table resulted in "No value provided" error on query execution and in "unsupported Lua type 'function'" error on variable type validation.

Reworks: introduce tests, separate from descriptions commit.

@DifferentialOrange DifferentialOrange force-pushed the DifferentialOrange/fix-type-as-table branch from 4399f75 to 2e5f29c Compare December 2, 2021 09:12
@Totktonada Totktonada self-requested a review December 8, 2021 04:20
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.

Looks hacky, but I can't propose a better solution. At least, tests are passed. Feel free to proceed.

I suggest to leave comments here with brief explanation, why such tweaks are legal and don't break anything. And why they're needed.

@DifferentialOrange DifferentialOrange force-pushed the DifferentialOrange/fix-type-as-table branch from 2e5f29c to 9addc76 Compare December 14, 2021 06:25
@DifferentialOrange
Copy link
Member Author

DifferentialOrange commented Dec 14, 2021

Looks hacky, but I can't propose a better solution. At least, tests are passed. Feel free to proceed.

I suggest to leave comments here with brief explanation, why such tweaks are legal and don't break anything. And why they're needed.

We already support describing output arguments type with table, for example, here:

if argument.kind then argument = argument.kind end
It doesn't break existing behavior, it just adds additional support which is consistent to existing one. Why do we need it? For correct support of input arguments descriptions.

@Totktonada
Copy link
Member

So it is purely to support this new way to delare arguments in the schema? Well, how about commenting all blocks, which are for supporting it? I'm pretty sure that it is not obvious from the code itself.

Before this patch, describing argument type in schema with a table
resulted in "No value provided" error on query execution.

Based on PR #22 by @no1seman
Before this patch, describing argument type in schema with a table
resulted in "unsupported Lua type 'function'" error on variable
type validation.

Based on PR #22 by @no1seman
@DifferentialOrange DifferentialOrange force-pushed the DifferentialOrange/fix-type-as-table branch from 9addc76 to 489d8be Compare December 14, 2021 11:13
@DifferentialOrange
Copy link
Member Author

So it is purely to support this new way to delare arguments in the schema? Well, how about commenting all blocks, which are for supporting it? I'm pretty sure that it is not obvious from the code itself.

Added comments near lines of code.

@Totktonada Totktonada merged commit 4de3632 into master Dec 14, 2021
@Totktonada Totktonada deleted the DifferentialOrange/fix-type-as-table branch December 14, 2021 11:21
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.

4 participants