Comments (7)
You can pass graphiql=False
as a kwarg, but maybe we should improve the wording on this, since we now support other explorers 😊
from strawberry.
@erikwrede maybe we should also support None?
from strawberry.
Thanks for your attention and fast reply. I tried graphiql=False but I still failed.
But then I noticed an interesting phenomenon.
When I run your suggestion (graphiql=False) with django debug server, (python ./manage.py runserver) it works correctly.
But I run it in a production environment it doesn't work.
I'm serving it with a uvicorn thread under gunicorn.
My command for a production environment is : gunicorn -k uvicorn.workers.UvicornWorker --workers 2 --threads 3
When I run the server with this command, graphiql=False parameter is ignored. I don't understand why.
I'm using django channels and I think this might have something to do with it.
Can you take a look at this one more time?
from strawberry.
I found the solution by myself.
When I use channels, graphiql option should be given for GraphQLHTTPConsumer. The following worked for me.
gql_http_consumer = AuthMiddlewareStack(GraphQLHTTPConsumer.as_asgi(schema=schema, graphql_ide=None))
Thanks.
from strawberry.
Keeping this open as this seems like a good case for a DevX improvement. @patrick91 I think =None is also an option.
from strawberry.
Hello! I was wondering if I could fix this. However, with the following code snippet I see no graphiql_ide. Can you check if it's fixed by now?
My urls.py
in django project
from django.urls import path
from strawberry.django.views import AsyncGraphQLView
import typing
import strawberry
@strawberry.type
class Book:
title: str
author: str
def get_books():
return [
Book(
title="The Great Gatsby",
author="F. Scott Fitzgerald",
),
]
@strawberry.type
class Query:
books: typing.List[Book] = strawberry.field(resolver=get_books)
schema = strawberry.Schema(query=Query)
urlpatterns = [
path("graphql/", AsyncGraphQLView.as_view(schema=schema,
graphql_ide=None)),
]
from strawberry.
@Birdi7 I don't think it has been fixed yet 😊
https://github.com/strawberry-graphql/strawberry/blob/main/strawberry/http/ides.py#L9-L30 we don't check for None here
from strawberry.
Related Issues (20)
- make to_pydantic function recursive
- Unable to hide field in derived type HOT 1
- Execution Context errors
- Expose common request on extensions' context
- Add support for using FastAPI APIRouter arguments in GraphQLRouter HOT 1
- Feature Request: Info context in scalar serialization HOT 2
- Broken documentation examples in page https://strawberry.rocks/docs/guides/dataloaders HOT 6
- `print_schema` does not prefix the `extend` keyword when Schema uses apollo federation HOT 3
- Property variable_values from class Info returning wrong information HOT 12
- Improve how we find concrete type for generic in interfaces (and potentially unions)
- Add better support for nested generics
- endless integrations with all python framworks HOT 1
- Upgrade causes "no current event loop in thread" exception HOT 1
- Opentelemetry creating one span per object HOT 1
- Mypy crashes if pydantic model and strawberry model has different fields HOT 1
- Ability to disable auto-camelcasing per field HOT 3
- `strawberry.Parent` not supporting forward refs HOT 1
- Debug server returns "ERR_INVALID_HTTP_RESPONSE" HOT 1
- Descriptions don't work with pydantic decorators HOT 2
- `Annotated` + `strawberry.lazy` + deferred annotations results in `UnresolvedFieldTypeError: Could not resolve the type of ...` errors HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from strawberry.