Skip to content

Fix endpoint #41

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

Merged
merged 2 commits into from
Jun 3, 2025
Merged

Fix endpoint #41

merged 2 commits into from
Jun 3, 2025

Conversation

ejfine
Copy link
Contributor

@ejfine ejfine commented Jun 3, 2025

Why is this change necessary?

The graphql endpoint was being obscured by the static file mount

How does this change address the issue?

Rearranges the ordering of path definitions

What side effects does this change have?

None

How is this change tested?

unit test and live in downstream repo

@ejfine ejfine requested a review from Copilot June 3, 2025 21:46
@ejfine ejfine self-assigned this Jun 3, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR ensures the GraphQL endpoint isn’t shadowed by static file serving by reordering mounts, adds a corresponding unit test, and updates the template version.

  • Moves the StaticFiles mount in app_def.py.jinja below route and middleware setup so API routes take precedence.
  • Adds test_When_graphql_route_called__Then_rendered to test_healthcheck.py.jinja to verify the GraphQL UI renders.
  • Bumps the _commit field in .copier-answers.yml from v0.0.49 to v0.0.53.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tests/unit/test_healthcheck.py.jinja Wrapped import in a raw block, inserted GraphQL UI test, and adjusted raw tags
src/backend_api/app_def.py.jinja Relocated app.mount below the GraphQL router to fix endpoint precedence
.copier-answers.yml Updated _commit version to align with latest template release
Comments suppressed due to low confidence (4)

template/backend/tests/unit/test_healthcheck.py.jinja:1

  • [nitpick] The use of multiple {% raw %}/{% endraw %} tags throughout this template clutters the file. Consider wrapping the entire test block in a single raw block and only using Jinja conditionals for the GraphQL sections for better readability.
{% raw %}import time

template/backend/tests/unit/test_healthcheck.py.jinja:33

  • Instead of creating a new TestClient(app), consider reusing the existing client fixture for consistency with the Swagger test.
def test_When_graphql_route_called__Then_rendered():

template/backend/src/backend_api/app_def.py.jinja:77

  • Because the static file mount is now inside the try block, an error in middleware or router setup would prevent static files from serving. Consider placing the mount call after the try/except to guarantee static files are always mounted.
app.mount(

@ejfine ejfine merged commit 2cf7191 into main Jun 3, 2025
11 checks passed
@ejfine ejfine deleted the fix-endpoint branch June 3, 2025 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant