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

Execute Query from GraphQL Foundation extension does not work with workbench #81

Open
michael-watson opened this issue Apr 12, 2021 · 4 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@michael-watson
Copy link
Collaborator

michael-watson commented Apr 12, 2021

114432015-75f5c800-9bc0-11eb-8cc2-a1e73f9c8116

This might be a challenge because I think the extension is defaulting where it is executing that query towards.

@michael-watson michael-watson added enhancement New feature or request good first issue Good for newcomers labels Apr 12, 2021
@michael-watson michael-watson self-assigned this Apr 12, 2021
@michael-watson michael-watson changed the title Execute Query from Apollo GraphQL extension does not work with workbench Execute Query from GraphQL Foundation extension does not work with workbench Apr 12, 2021
@michael-watson
Copy link
Collaborator Author

I found out how to get this to work, there are 2 options available:

  1. In your VSCode settings, change the gateway port for your mocks: "apollo-workbench.gatewayPort": 8000
  2. Add a graphql.config.js file that exposes the gateway port url used for your mocks:
module.exports = {
    projects: {
        app: {
            extensions: {
                endpoints: {
                    default: {
                        url: "http://localhost:5000"
                    },
                },
            }
        }
    }
}

I'm going to leave this issue open until I ship a change that includes this into the docs.

@michael-watson michael-watson added documentation Improvements or additions to documentation and removed enhancement New feature or request good first issue Good for newcomers labels Apr 12, 2021
@michael-watson
Copy link
Collaborator Author

Will also plan on defaulting our gateway to align with the port used by the GraphQL extension

@saadsaifse
Copy link

This is great! I tried the second option which is working. Thanks!
I think we need to keep in mind the collaboration/configuration of this extension with GraphQL and Apollo GraphQL extensions to have a consistent configuration and working experience.

@michael-watson
Copy link
Collaborator Author

Thanks @saadsaifse for all your feedback so far. It's been great! 🎉

I totally understand about the other Apollo extension and it's configuration. It's something we've learned a lot from and the new rover cli doesn't use a config file like that. I will pass this feedback along to our internal team. My initial goal with Workbench was to have no configuration at all if you want, but I didn't even think the GraphQL extension (I just don't use it currently). I'm going to make sure the defaults play nicely together and just work because that is what I would expect. I wouldn't have known about this if you didn't bring it up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants