graphql-python / graphql-python/graphql-core-legacy

List types are not correctly validated

オープン
#97 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
372
フォーク
175
PR マージ指標
30日以内にマージされた PR はありません

説明

Consider the following test case:
```
from graphql.language.parser import parse
from graphql.utils.build_ast_schema import build_ast_schema
from graphql.validation import validate

def test_list_literal_validation():
schema_text = '''
schema {
query: RootSchemaQuery
}

directive @foo(list: [String!]!) on FIELD | INLINE_FRAGMENT

type Bar {
name: String
}

type RootSchemaQuery {
Bar: Bar
}
'''
schema = build_ast_schema(parse(schema_text))

query = '''
query Baz {
Bar {
name @foo(list: "not_a_list")
}
}
'''
query_ast = parse(query)

errors = validate(schema, query_ast)
assert errors
```

Note that the directive `@foo` requires a list argument, but is passed a string argument instead. Despite this problem, this library claims that the GraphQL query validates with no errors, failing the test. I believe this to be a bug.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。