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

useHttpGetMethodForQueries is not working #1317

Closed
woodyLam opened this issue May 21, 2019 · 6 comments
Closed

useHttpGetMethodForQueries is not working #1317

woodyLam opened this issue May 21, 2019 · 6 comments

Comments

@woodyLam
Copy link

I want to using HTTP GET method for Auto Persisted Queries, but all requests still using POST method even I set useHttpGetMethodForQueries = true

ApolloClient.builder().useHttpGetMethodForQueries(true).enableAutoPersistedQueries(true)

@sav007
Copy link
Contributor

sav007 commented May 21, 2019

This flag is used for queries only. Mutations are not supported. Are you sure that query operations still sent as POST?

@woodyLam
Copy link
Author

yes, i am using query operations and all query sent as POST

@nightbear1009
Copy link
Contributor

nightbear1009 commented May 22, 2019

I find out in RealApolloCall.java at line 119 - 121

interceptorChain = prepareInterceptorChain(operation);
optimisticUpdates = builder.optimisticUpdates;
useHttpGetMethodForQueries = builder.useHttpGetMethodForQueries;

should be like as below prepareInterceptorChain is using useHttpGetMethodForQueries, but useHttpGetMethodForQueries is not assigning value until line 121

useHttpGetMethodForQueries = builder.useHttpGetMethodForQueries;
interceptorChain = prepareInterceptorChain(operation);
optimisticUpdates = builder.optimisticUpdates;

@wooyukit
Copy link

I tried to move up useHttpGetMethodForQueries = builder.useHttpGetMethodForQueries; but it doesn't work as well.

@Codebear98
Copy link
Contributor

Codebear98 commented Jun 4, 2019

The above code seems have been fixed at 3eafed9 in Master.
Nows
enableAutoPersistedQueries = builder.enableAutoPersistedQueries; useHttpGetMethodForPersistedQueries = builder.useHttpGetMethodForPersistedQueries; interceptorChain = prepareInterceptorChain(operation);

However, for issue we really wanna do is integrate APQs with CDN which requires HttpGetMethod.

@sav007
Copy link
Contributor

sav007 commented Jul 9, 2019

Fixed.

@sav007 sav007 closed this as completed Jul 9, 2019
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

5 participants