Skip to content

Commit

Permalink
Bump graphql-core from 3.1.7 to 3.2.0 in /tests (#332)
Browse files Browse the repository at this point in the history
* Bump graphql-core from 3.1.7 to 3.2.0 in /tests

Bumps [graphql-core](https://github.com/graphql-python/graphql-core) from 3.1.7 to 3.2.0.
- [Release notes](https://github.com/graphql-python/graphql-core/releases)
- [Commits](graphql-python/graphql-core@v3.1.7...v3.2.0)

---
updated-dependencies:
- dependency-name: graphql-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix trailing new lines in graphql schema

See graphql-python/graphql-core#157

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joseph Perez <joperez@hotmail.fr>
  • Loading branch information
3 people committed Jan 28, 2022
1 parent 939a31c commit 3c386de
Show file tree
Hide file tree
Showing 32 changed files with 37 additions and 73 deletions.
3 changes: 1 addition & 2 deletions README.md
Expand Up @@ -105,8 +105,7 @@ type Resource {
id: ID!
name: String!
tags: [String!]!
}
"""
}"""
assert print_schema(schema) == schema_str
```
*apischema* works out of the box with your data model.
Expand Down
3 changes: 1 addition & 2 deletions examples/additional_types.py
Expand Up @@ -34,6 +34,5 @@ def bar() -> Bar:
type Query {
bar: Bar!
}
"""
}"""
assert print_schema(schema) == schema_str
3 changes: 1 addition & 2 deletions examples/base_schema_parameter.py
Expand Up @@ -54,6 +54,5 @@ def foo() -> Foo:
"""arg parameter"""
arg: String!
): Int!
}
'''
}'''
assert print_schema(schema_) == schema_str
3 changes: 1 addition & 2 deletions examples/enum_schemas.py
Expand Up @@ -28,7 +28,6 @@ def echo(enum: MyEnum) -> MyEnum:
"""foo"""
FOO
BAR
}
'''
}'''
assert print_schema(schema_) == schema_str
assert graphql_sync(schema_, "{echo(enum: FOO)}").data == {"echo": "FOO"}
3 changes: 1 addition & 2 deletions examples/examples/sqlalchemy_support.py
Expand Up @@ -76,6 +76,5 @@ def foos() -> Collection[Foo] | None:
type Foo {
bar: Int!
baz: String
}
"""
}"""
assert print_schema(schema) == schema_str
6 changes: 2 additions & 4 deletions examples/examples/subclass_tagged_union.py
Expand Up @@ -167,8 +167,7 @@ def echo(drawing: Drawing = None) -> Drawing | None:
input ConcatInput {
left: DrawingInput!
right: DrawingInput!
}
"""
}"""
)

query = """\
Expand Down Expand Up @@ -200,8 +199,7 @@ def echo(drawing: Drawing = None) -> Drawing | None:
}
}
}
}
"""
}"""

assert graphql.graphql_sync(drawing_schema, query).data == {
"echo": {
Expand Down
6 changes: 2 additions & 4 deletions examples/graphql_overview.py
Expand Up @@ -71,8 +71,7 @@ def user(username: str) -> User | None:
content: String!
}
scalar Datetime
"""
scalar Datetime"""
assert print_schema(schema) == schema_str

query = """
Expand All @@ -83,8 +82,7 @@ def user(username: str) -> User | None:
content
}
}
}
"""
}"""
assert graphql_sync(schema, query).data == {
"users": [
{"username": "foo", "posts": [{"content": "Hello world!"}]},
Expand Down
3 changes: 1 addition & 2 deletions examples/graphql_type_name.py
Expand Up @@ -24,6 +24,5 @@ def foo() -> FooFoo | None:
type Foo {
bar: Int!
}
"""
}"""
assert print_schema(schema) == schema_str
3 changes: 1 addition & 2 deletions examples/id_type.py
Expand Up @@ -24,6 +24,5 @@ def foo() -> Foo | None:
type Foo {
bar: ID!
}
"""
}"""
assert print_schema(schema) == schema_str
3 changes: 1 addition & 2 deletions examples/interface.py
Expand Up @@ -33,6 +33,5 @@ def foo() -> Foo | None:
interface Bar {
bar: Int!
}
"""
}"""
assert print_schema(schema) == schema_str
3 changes: 1 addition & 2 deletions examples/operation.py
Expand Up @@ -24,6 +24,5 @@ async def get_foo() -> Foo:
type Foo {
bar(arg: Int! = 0): String!
}
"""
}"""
assert print_schema(schema) == schema_str
3 changes: 1 addition & 2 deletions examples/quickstart.py
Expand Up @@ -67,6 +67,5 @@ def resources(tags: Collection[str] | None = None) -> Collection[Resource] | Non
id: ID!
name: String!
tags: [String!]!
}
"""
}"""
assert print_schema(schema) == schema_str
3 changes: 1 addition & 2 deletions examples/relay_client_mutation_id.py
Expand Up @@ -59,6 +59,5 @@ def hello() -> str:
factionId: String!
shipName: String!
clientMutationId: String!
}
"""
}"""
assert print_schema(schema) == schema_str
6 changes: 2 additions & 4 deletions examples/relay_connection.py
Expand Up @@ -60,8 +60,7 @@ def faction() -> Faction | None:
hasNextPage: Boolean!
startCursor: Int
endCursor: Int
}
"""
}"""
assert print_schema(schema) == schema_str
query = """
{
Expand All @@ -79,8 +78,7 @@ def faction() -> Faction | None:
}
}
}
}
"""
}"""
assert graphql.graphql_sync(schema, query).data == {
"faction": {
"ships": {
Expand Down
3 changes: 1 addition & 2 deletions examples/relay_connection_subclass.py
Expand Up @@ -72,6 +72,5 @@ def faction() -> Faction | None:
hasNextPage: Boolean!
startCursor: Int
endCursor: Int
}
"""
}"""
assert print_schema(schema) == schema_str
3 changes: 1 addition & 2 deletions examples/relay_global_id.py
Expand Up @@ -25,8 +25,7 @@ def get_by_id(cls, id: int, info: graphql.GraphQLResolveInfo = None) -> "Faction
name
}
}
}
"""
}"""
assert graphql.graphql_sync( # ... and use it in a query
schema, query, variable_values={"id": serialize(relay.GlobalId, some_global_id)}
).data == {"node": {"name": "Empire"}}
3 changes: 1 addition & 2 deletions examples/relay_mutation.py
Expand Up @@ -53,6 +53,5 @@ def hello() -> str:
factionId: String!
shipName: String!
clientMutationId: String
}
"""
}"""
assert print_schema(schema) == schema_str
3 changes: 1 addition & 2 deletions examples/relay_node.py
Expand Up @@ -43,6 +43,5 @@ def get_by_id(cls, id: int, info: graphql.GraphQLResolveInfo = None) -> "Faction
type Query {
node(id: ID!): Node!
}
"""
}"""
assert print_schema(schema) == schema_str
3 changes: 1 addition & 2 deletions examples/resolver.py
Expand Up @@ -33,6 +33,5 @@ async def foo() -> Foo | None:
type Bar {
baz: Int!
}
"""
}"""
assert print_schema(schema) == schema_str
3 changes: 1 addition & 2 deletions examples/resolver_error.py
Expand Up @@ -44,8 +44,7 @@ def foo(info: graphql.GraphQLResolveInfo) -> Foo:
type Foo {
bar: Int
baz: Int!
}
"""
}"""
assert print_schema(schema) == schema_str
# Logs "Resolve error in foo.bar", no error raised
assert graphql.graphql_sync(schema, "{foo{bar}}").data == {"foo": {"bar": None}}
Expand Down
3 changes: 1 addition & 2 deletions examples/resolver_metadata.py
Expand Up @@ -32,6 +32,5 @@ def foo() -> Foo:
"""argument"""
arg: Int!
): Int!
}
'''
}'''
assert print_schema(schema_) == schema_str
3 changes: 1 addition & 2 deletions examples/scalar.py
Expand Up @@ -30,6 +30,5 @@ def foo() -> Foo | None:
scalar UUID
scalar JSON
"""
scalar JSON"""
assert print_schema(schema) == schema_str
3 changes: 1 addition & 2 deletions examples/subscription.py
Expand Up @@ -24,8 +24,7 @@ async def events() -> AsyncIterable[str]:
type Subscription {
events: String!
}
"""
}"""
assert print_schema(schema) == schema_str


Expand Down
3 changes: 1 addition & 2 deletions examples/subscription_resolve.py
Expand Up @@ -38,8 +38,7 @@ class Message:
type Message {
body: String!
}
"""
}"""
assert print_schema(schema) == schema_str


Expand Down
6 changes: 2 additions & 4 deletions examples/tagged_union_graphql_schema.py
Expand Up @@ -43,8 +43,7 @@ def query(foo: Foo) -> Foo:
input BarInput {
field: String!
}
"""
}"""
assert print_schema(schema) == schema_str

query_str = """
Expand All @@ -55,8 +54,7 @@ def query(foo: Foo) -> Foo:
}
baz
}
}
"""
}"""
assert graphql_sync(schema, query_str).data == {
"query": {"bar": {"field": "value"}, "baz": None}
}
3 changes: 1 addition & 2 deletions examples/union_type_name.py
Expand Up @@ -34,6 +34,5 @@ def foo_or_bar() -> Foo | Bar:
type Bar {
bar: Int!
}
"""
}"""
assert print_schema(schema) == schema_str
3 changes: 1 addition & 2 deletions tests/integration/test_annotated_schema.py
Expand Up @@ -82,6 +82,5 @@ def test_annotated_schema():
}
"""type description"""
scalar someInt
'''
scalar someInt'''
)
3 changes: 1 addition & 2 deletions tests/integration/test_default_conversion_type_name.py
Expand Up @@ -35,8 +35,7 @@ def test_default_conversion_type_name():
type B {
a: Int!
}
"""
}"""
)
assert serialization_schema(B, all_refs=True) == {
"$ref": "#/$defs/B",
Expand Down
Expand Up @@ -32,8 +32,7 @@ def resolver(arg=default) -> bool:
== """\
type Query {
resolver(arg: Int): Boolean!
}
"""
}"""
)
assert (
graphql_sync(schema, "{resolver}").data
Expand Down
2 changes: 1 addition & 1 deletion tests/requirements.txt
@@ -1,5 +1,5 @@
dataclasses==0.8;python_version<'3.7'
graphql-core==3.1.7
graphql-core==3.2.0
attrs==21.4.0
bson==0.5.10
docstring-parser==0.13
Expand Down
6 changes: 2 additions & 4 deletions tests/unit/test_flattened_conversion.py
Expand Up @@ -59,8 +59,7 @@ def test_flattened_dataclass_model():
type Data {
attr: Int!
}
"""
}"""
)


Expand Down Expand Up @@ -126,8 +125,7 @@ def test_flattened_converted():
type Data2 {
attr: Int!
}
"""
}"""
)


Expand Down
3 changes: 1 addition & 2 deletions tests/unit/test_subscriptions.py
Expand Up @@ -84,8 +84,7 @@ async def test_subscription(alias, conversion, error_handler, resolver):
type Subscription {
%s
}
"""
}"""
assert print_schema(schema) == schema_str % sub_field
sub_query = sub_name
if conversion is None:
Expand Down

0 comments on commit 3c386de

Please sign in to comment.