-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"get_type_map" not found in the Schema #1
Comments
Hey @PriyatamNayak. Thanks for reporting the issue 🪲 What version of |
(env) C:\Repository\django_graphql>pip freeze Django==3.2 |
@wallee94 class Query(graphene.ObjectType):
|
@PriyatamNayak Thanks, I was able to reproduce the error. The code wasn't compatible with graphene 3 yet. You will have to change the next line when using graphene>=3: html = graphdoc.to_doc(GraphQLView().schema) to: html = graphdoc.to_doc(GraphQLView().schema.graphql_schema) |
Thanks for you fix..you are awesome @wallee94 Could you please also tell me ,how can use the graphdocs using fastapi and graphene |
Sure! from fastapi import FastAPI, Response
from graphene_django.views import GraphQLView
import graphdoc
app = FastAPI()
@app.get("/docs")
async def graphql_docs():
html = graphdoc.to_doc(GraphQLView().schema.graphql_schema)
return Response(content=html, media_type="text/html") About changing the header, I want to release this feature in a new version next week, using custom jinja templates, but right now it's not possible. |
Thanks bro |
Will wait for the release |
File "C:\Repository\django_graphql\env\lib\site-packages\graphdoc\utilities.py", line 43, in build_types_reference
type_map = schema.type_map if hasattr(schema, 'type_map') else schema.get_type_map()
File "C:\Repository\django_graphql\env\lib\site-packages\graphene\types\schema.py", line 552, in getattr
raise AttributeError(f'Type "{type_name}" not found in the Schema')
The text was updated successfully, but these errors were encountered: