Skip to content

Commit 03e00bd

Browse files
committed
[0.4.2b2] Release 0.4.2b2 release - fix format_error and punctuation in an error message.
1 parent 7a10762 commit 03e00bd

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

graphql/core/error.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,13 @@ def locations(self):
4040

4141

4242
def format_error(error):
43-
return {
43+
formatted_error = {
4444
'message': error.message,
45-
'locations': [
45+
}
46+
if error.locations is not None:
47+
formatted_error['locations'] = [
4648
{'line': loc.line, 'column': loc.column}
4749
for loc in error.locations
48-
],
49-
}
50+
]
51+
52+
return formatted_error

graphql/core/execution/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def __init__(self, schema, root, document_ast, operation_name, args, request_con
4141
for definition in document_ast.definitions:
4242
if isinstance(definition, ast.OperationDefinition):
4343
if not operation_name and operation:
44-
raise GraphQLError('Must provide operation name if query contains multiple operations')
44+
raise GraphQLError('Must provide operation name if query contains multiple operations.')
4545

4646
if not operation_name or definition.name and definition.name.value == operation_name:
4747
operation = definition

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name='graphql-core',
5-
version='0.4.7b1',
5+
version='0.4.7b2',
66
description='GraphQL implementation for Python',
77
url='https://github.com/graphql-python/graphql-core',
88
download_url='https://github.com/graphql-python/graphql-core/releases',

0 commit comments

Comments
 (0)