question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add GET support to NetworkInterface

See original GitHub issue

I have an application where the ReactJS app is hosted on one domain, and the Django service (using Graphene) is hosted on another. The ReactJS app needs to access the data in the Django app.

Steps to Reproduce

Since Apollo defaults to using POST for queries, I’m hitting a CSRF issue when trying to access the data. At this time, since these APIs are all read-only, I’m using csrf_exempt on the GraphQLView and this is working OK.

However, I would much prefer to use GET for my read requests.

After some digging, I found that I could modify the method to GET by using applyMiddleware and modifying req.options.method = "GET". However, It is still trying to post a BODY, which is not allowed in a GET. I tried doing delete req.request.query but that didn’t seem to help. I didn’t really expect that second part to work, but gave it a shot anyway… 😃

Expected Behavior

Would you be able to either provide an additional NetworkInterface that uses GET or some documentation on how to create our own?

Version

  • apollo-client@1.0.2
  • react-apollo@1.0.1

Note:

This issue was originally posted on react-apollo but closed because it really belongs here.
https://github.com/apollographql/react-apollo/issues/624#issuecomment-293742620

I may create a PR for this feature at some point, if I get the bandwidth.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
n1ru4lcommented, Jun 2, 2017

I implemented such a network interface in an application a few days ago: https://gist.github.com/n1ru4l/cb24401592417bda7fad989d416f0b9f

0reactions
stale[bot]commented, Jul 29, 2017

This issue has been automatically closed because it has not had recent activity after being marked as stale. If you belive this issue is still a problem or should be reopened, please reopen it! Thank you for your contributions to Apollo Client!

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS::EC2::NetworkInterface - AWS CloudFormation
This example attaches a network interface to an EC2 instance. You can use the NetworkInterface property to add more than one network interface....
Read more >
NetworkInterface - Android Developers
Get a network interface given its index. ... Get the display name of this network interface. byte[], getHardwareAddress().
Read more >
NetworkInterface Class (System.Net.NetworkInformation)
Gets a Boolean value that indicates whether the interface supports the specified protocol. Applies to. Product, Versions .NET, Core 1.0, Core 1.1, Core...
Read more >
3 ways to configure a network interface in Linux - Red Hat
I'll skip that so you can get on into the point of the article: Three ways to configure network interfaces. In each case,...
Read more >
Set up a network service on Mac - Apple Support
Click the Action pop-up menu on the right, then choose Add Service. Click the Interface pop-up menu, then choose a network interface.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found