Skip to content
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

Generating Swagger/OpenAPI schema should not require generating GraphQL schema #1603

Closed
glennmatthews opened this issue Apr 4, 2022 · 0 comments · Fixed by #1994
Closed
Assignees
Labels
type: bug Something isn't working as expected

Comments

@glennmatthews
Copy link
Contributor

Environment

  • Python version:
  • Nautobot version: 1.3.0b2

Steps to Reproduce

  1. Enable debug logging on Nautobot
  2. Access /api/docs/
  3. Check logs

Alternately, with #1544 in place, simply run nautobot-server spectacular --file nautobot.openapi.yaml

Expected Behavior

Rapid OpenAPI schema generation

Observed Behavior

Schema generation is relatively slow, and logs indicate that a significant amount of the time is spent generating the GraphQL schema as part of the OpenAPI schema rendering:

12:52:13.849 INFO    nautobot.graphql.schema schema.py                 generate_query_mixin() :
  Beginning generation of Nautobot GraphQL schema
12:52:13.849 DEBUG   nautobot.graphql.schema schema.py                 generate_query_mixin() :
  Generating dynamic schemas for all models in the models_features graphql registry
12:52:13.987 DEBUG   nautobot.graphql.schema schema.py                 generate_query_mixin() :
  Adding plugins' statically defined graphql schema types
12:52:13.987 DEBUG   nautobot.graphql.schema schema.py                 generate_query_mixin() :
  Extending all registered schema types with dynamic attributes
12:52:18.915 INFO    nautobot.graphql.schema schema.py                 generate_query_mixin() :
  Generation of Nautobot GraphQL schema complete

We should not need to render the entire GraphQL schema in order to render the REST API schema.

@glennmatthews glennmatthews added type: bug Something isn't working as expected status: accepted labels Apr 4, 2022
@timizuoebideri1 timizuoebideri1 self-assigned this Jun 29, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't working as expected
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants