Testing without web server #497
Replies: 5 comments
-
|
Beta Was this translation helpful? Give feedback.
-
Yes thanks, but I do not have (or need) web server. I'm using GraphQL in batch mode... |
Beta Was this translation helpful? Give feedback.
-
Can you describe your setup in more detail? If you have a server (any kind of server) then couldn't you run it in your |
Beta Was this translation helpful? Give feedback.
-
I am guessing @stef-pellegrino is looking for something like |
Beta Was this translation helpful? Give feedback.
-
@stef-pellegrino you could do something like the following import asyncio
from ariadne import make_executable_schema
from graphql import graphql
schema = make_executable_schema(FILL THIS OUT)
from graphql import graphql
async def query_artoo():
result = await graphql(schema, """
{
droid(id: "2001") {
name
primaryFunction
}
}
""")
print(result)
asyncio.get_event_loop().run_until_complete(query_artoo()) But this doesn't take care of context ^^ |
Beta Was this translation helpful? Give feedback.
-
Is it possible to test with a simple command line instead of always using web server ?
Beta Was this translation helpful? Give feedback.
All reactions