Skip to content

Cannot disable footer link Other API docs: GraphiQL #7108

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

Closed
colonelclick opened this issue Apr 22, 2025 · 1 comment
Closed

Cannot disable footer link Other API docs: GraphiQL #7108

colonelclick opened this issue Apr 22, 2025 · 1 comment

Comments

@colonelclick
Copy link

colonelclick commented Apr 22, 2025

API Platform version(s) affected: 4.1.7

Description
Cannot disable footer link Other API docs: GraphiQL even when disabled by configuration.

How to reproduce
Configure in api_platform.yaml, but link will still be present.

api_platform:
    graphql:
        enabled: false
        graphiql:
            enabled: false

Possible Solution
Seems to be a logic error in line 86 of vendor/api-platform/symfony/Bundle/Resources/views/SwaggerUi/index.html.twig but I do not understand the reason for the multiple checks present in that line so I do not have a specific suggestion on how to change it. Maybe leftovers from a previous version of this template?

(carriage returns added by me for readability)

{% if not graphQlEnabled or graphiQlEnabled %}
    <a {% if graphiQlEnabled %}href="{{ path('api_graphql_graphiql') }}"{% endif %} class="graphiql-link">GraphiQL</a>
{% endif %}

Additional Context
I am using it with Symfony, but that fork directed me here for issues. If I can get some clarity on the intent of the nested checks, I could look at making a PR for this.

I dumped the graphiQlEnabled value and observed it is set to false, so the href is not present, but the text still appears on the page.

@colonelclick
Copy link
Author

I just went to double-check my notes on this, and it looks like I might have made a mistake with my cache because I can no longer reproduce it. I'm closing this for now so as not to waste anyone's time. Thank you.

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

No branches or pull requests

1 participant