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
Allow GraphQL endpoint to be conditionally included. Closes #209 #210
Allow GraphQL endpoint to be conditionally included. Closes #209 #210
Conversation
2e3151c
to
e744029
Compare
@waiting-for-dev could you take a glance at this when you get a chance? Thank you! |
Hey @zachfeldman, many thanks for sending this change request. I'd like to understand the context here better. Given that the endpoint will only be made available when you install the extension into your project, in which situation would you like to turn it off? Is the idea to have the configuration act like a feature flag? I can think of two approaches that don't involve moving the feature flag upstream:
What do you think? |
Hey @waiting-for-dev thanks for the fast response here! The use case is that we're testing GraphQL in development, but also in our Review Apps and Staging env on Heroku that are "production" environments. So just putting them in a specific group in the We don't want to turn it on in prod yet because we haven't analyzed the security implications of it, nor is our new front end ready for prime time quite yet. I think option 2 would work really well, and I know that's how you're doing it with the new admin. If you are down with that based on the above, I can change my PR to do this instead and also edit the README! |
That would be awesome, @zachfeldman. Looking forward to it. Please, let me know if you need any help. |
e744029
to
0d8dcb8
Compare
@waiting-for-dev I copied from the main Solidus repo and this seems to work locally for me when using this branch and running the generator - how's that? |
Hey, @zachfeldman, it looks like the GraphQL controller is not found. That's probably because we're not mounting the engine into the host application. We need to inject something like the following in the host routes:
And define the route in the engine I tried locally, but still it didn't work. I run out of time today, but I'll try again tomorrow unless you're quicker than me 🙂 |
0d8dcb8
to
648ccfb
Compare
@waiting-for-dev this commit seems to do it right for me! LMK if you have any opinions about the URL structure or the class name for routing, glad to adjust. |
lib/generators/solidus_graphql_api/install/install_generator.rb
Outdated
Show resolved
Hide resolved
648ccfb
to
13bb9dd
Compare
@waiting-for-dev updated! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for working on this, @zachfeldman! ❤️
Summary
Adds a Rails configuration option to include
/graphql
only if it is true.Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: