Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Enhance validation and introduce error codes #180

Merged
merged 20 commits into from
Jul 2, 2018
Merged

Conversation

Totktonada
Copy link
Member

@Totktonada Totktonada commented Jun 20, 2018

Fixes #159.
Fixes #160.
Fixes #134.

@Totktonada Totktonada added enhancement New feature or request customer labels Jun 20, 2018
@Totktonada Totktonada self-assigned this Jun 20, 2018
@Totktonada Totktonada force-pushed the gh-134-error-codes branch 2 times, most recently from 1e797a9 to fe77afd Compare June 22, 2018 12:58
Success case: {data = ...}
Error case: {errors = {message = ..., ...}}

compiled_query:execute(...) becomes exception-safe (performs pcall
internally), but graphql.new(...):compile() and
graphql.new(...).execute(...) still can throw an exception.

Enabled 5_2 test in common.test.lua, it fails before fix for #135 (
PR #178).

Prerequisite for #71.
Prerequisite for #134.
We lean on gql_wrapper.disable_dangling_check value before, but now we
don't.
It is needed to avoid possible name clash with future versions of
GraphQL standard. June, 2018 version of the standard strongly recommends
to use `extensions` field for custom fields of an error.

[1]: https://github.com/facebook/graphql/pull/407/files
[2]: https://github.com/facebook/graphql/releases/tag/June2018
@Totktonada Totktonada force-pushed the gh-134-error-codes branch from fe77afd to 69040ca Compare June 22, 2018 20:44
Fixed resulting_object_cnt counter in case of a filter by 1:1
connection.

Part of #71.
@Totktonada Totktonada force-pushed the gh-134-error-codes branch 3 times, most recently from 2c7fc9b to ebcdd14 Compare June 29, 2018 12:26
Fixed Int type to be between -2^31 and 2^31-1 instead of -2^32 and
2^32-1.

Forbid implicit fraction part removing from Int immediate value.

Fixed Long type to forbid variable value of 'number' Lua type that
cannot preciselly represent integral value (allow only ones inside -2^53
and 2^53 exclusivelly).

Related to #159.
Related to #160.
@Totktonada Totktonada force-pushed the gh-134-error-codes branch from 079a916 to 9f22717 Compare July 2, 2018 02:15
It is because the cases use mutation arguments, which is disabled on
avro-schema-2*.
@Totktonada Totktonada force-pushed the gh-134-error-codes branch from 9f22717 to 9d681cd Compare July 2, 2018 03:01
It would be better to implement this check as compile-time via
rules.requiredArgumentsPresent or a similar rule for
argument/InputObject.

Related to #159.
Related to #160.
@Totktonada Totktonada changed the title WIP: Introduce error codes Introduce error codes Jul 2, 2018
@Totktonada Totktonada changed the title Introduce error codes Enhance validation and introduce error codes Jul 2, 2018
@Totktonada Totktonada requested a review from SudoBobo July 2, 2018 15:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
customer enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant