graphql-engine/server/tests-py/test_validation.py
Anon Ray a21f6cd648 introduce v1/graphql (fix #1368) (#2064)
Changes compared to `/v1alpha1/graphql`

* Changed all graphql responses in **/v1/graphql** endpoint to be 200. All graphql clients expect responses to be HTTP 200. Non-200 responses are considered transport layer errors. 

* Errors in http and websocket layer are now consistent and have similar structure.
2019-05-10 11:35:10 +05:30

21 lines
709 B
Python

import pytest
import yaml
from validate import check_query_f
from super_classes import GraphQLEngineTest
# @pytest.mark.parametrize("transport", ['http', 'websocket'])
# graphql parser can't seem to parse {where: null}, disabling
# websocket till then
@pytest.mark.parametrize("transport", ['http'])
class TestGraphQLValidation(GraphQLEngineTest):
def test_null_value(self, hge_ctx, transport):
check_query_f(hge_ctx, self.dir() + "/null_value_err.yaml", transport)
def test_null_variable_value(self, hge_ctx, transport):
check_query_f(hge_ctx, self.dir() + "/null_variable_value_err.yaml", transport)
@classmethod
def dir(cls):
return "queries/graphql_validation"