GithubHelp home page GithubHelp logo

Comments (9)

paulpdaniels avatar paulpdaniels commented on May 5, 2024 3

Actually I just checked and it is already part of apollo-utilities. @fbartho I'd be willing to take this on if no one else is already working on it. Seems like a relatively easy fix. Will need to imagine some various test scenarios though...

from apollo-link-rest.

marcelombc avatar marcelombc commented on May 5, 2024 2

@paulpdaniels You're right. I'm using graphene on the server and I just needed to create a custom directive to support @export. Thanks for your help.

from apollo-link-rest.

fbartho avatar fbartho commented on May 5, 2024

Hey @chimon2000 -- this sounds like a big bug, do you feel comfortable submitting a unit-test for us that could reproduce this?

Alternately, a PR that fixes this would be even better. I'm happy to help, but my current main test environment doesn't use a real GraphQL server, so I'm not quite set up to verify that this is working.

from apollo-link-rest.

chimon2000 avatar chimon2000 commented on May 5, 2024

Hey @fbartho, thanks for the quick response. I added my example repo that contains the code necessary to reproduce the issue with both angular and (p)react examples, but I can see about adding a unit test for this as well.

I am not particularly adept with how apollo links work.

from apollo-link-rest.

ivank avatar ivank commented on May 5, 2024

Hey @fbartho, I've added a PR failing test for you guys to poke around - it is indeed a problem, hope its useful.

from apollo-link-rest.

paulpdaniels avatar paulpdaniels commented on May 5, 2024

Looking into the source it seems like the only time that forward is called to send the operation to the next link is here.

I think if we want to support the merging behavior we need to inspect the query strip out non-rest pieces and forward them to the next link.

I think basically copying this section from apollo-link-state would be sufficient (it might even make sense to coordinate with the maintainers to extract that kind of logic into a separate package since it seems really useful for link builders).

from apollo-link-rest.

fbartho avatar fbartho commented on May 5, 2024

@paulpdaniels Dude, I'd love that. Please do take it on.

Specific hazardous scenarios I want to make sure we support / don't break:

  • Nesting @rest() inside @rest() queries with `@export(as:…) in use
  • Nesting @rest() inside server-graphql queries with `@export(as:…) in use
  • Nesting @rest() inside @client queries
  • Making sure this doesn't break the Typename Patcher codepaths!

from apollo-link-rest.

marcelombc avatar marcelombc commented on May 5, 2024

export directive doesn't seem to work inside server-graphql queries. I get the following error: Unknown directive "export".

from apollo-link-rest.

paulpdaniels avatar paulpdaniels commented on May 5, 2024

@marcelombc it would depend on your server implementation I guess, apollo-server comes with it out of the box, but I don't think it is required to be spec compliant.

from apollo-link-rest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.