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

Does not work when called from PHP using do_graphql_request() #10

Open
esamattis opened this issue Nov 18, 2019 · 0 comments
Open

Does not work when called from PHP using do_graphql_request() #10

esamattis opened this issue Nov 18, 2019 · 0 comments
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@esamattis
Copy link
Member

esamattis commented Nov 18, 2019

See wp-graphql/wp-graphql#1021 (comment)

Actually wp-graphql-polylang cannot work at all when called from PHP. That's because Polylang initializes itself into a specific mode which maybe be "admin", "frontend" or "rest" and now via wp-graphql-polylang "graphl" too. Once the intialization has been done it cannot changed anymore (at least to my knowledge).

So in wp-graphql-polylang I must tell it to go to the graphql mode as soon as possible. If it is too late Polylang will initialize into the frontend mode. This does happen before the init. The frontend mode would filter everything by the default language which is no good for a graphql api because you'll want to specify the language using the where-args so you can query posts in multiple languages if you want.

@esamattis esamattis changed the title Does not work when called from PHP Does not work when called from PHP using do_graphql_request() Oct 21, 2020
@esamattis esamattis added bug Something isn't working wontfix This will not be worked on labels Nov 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant