Skip to content

Commit e9ce3d2

Browse files
committed
Moved all files one dir level to the top, removing core
1 parent 480bf4c commit e9ce3d2

File tree

155 files changed

+227
-226
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+227
-226
lines changed

graphql/__init__.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,32 @@
1515
This also includes utility functions for operating on GraphQL types and
1616
GraphQL documents to facilitate building tools.
1717
'''
18+
19+
from .execution import ExecutionResult, execute
20+
from .language.parser import parse
21+
from .language.source import Source
22+
from .validation import validate
23+
24+
25+
def graphql(schema, request='', root=None, args=None, operation_name=None):
26+
try:
27+
source = Source(request, 'GraphQL request')
28+
ast = parse(source)
29+
validation_errors = validate(schema, ast)
30+
if validation_errors:
31+
return ExecutionResult(
32+
errors=validation_errors,
33+
invalid=True,
34+
)
35+
return execute(
36+
schema,
37+
root or object(),
38+
ast,
39+
operation_name,
40+
args or {},
41+
)
42+
except Exception as e:
43+
return ExecutionResult(
44+
errors=[e],
45+
invalid=True,
46+
)

graphql/core/__init__.py

Lines changed: 0 additions & 28 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)