-
Notifications
You must be signed in to change notification settings - Fork 574
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
[v3] express.use() on custom path does not work without setting graphqlEndpoint
#1901
Comments
graphqlEndpoint
graphqlEndpoint
I have added a failing test case. I'm working on a fix, but for now I'm not sure how I can do this without introducing a breaking change. |
You have to define app.use('/my-path',
createYoga({
....,
graphqlEndpoint: '/my-path'
})
) |
Yes, that's a workaround, but I'm trying to find a fix which doesn't require the developer to duplicate the endpoint setting. If I don't find a good way to do it, I will just try to improve documentation to make it clear |
No it is not a workaround. It hasn't been documented yet, this is why we keep this issue open. |
Ok, I will update the documentation then :-) |
@ardatan Do you think I have to add this information in every pages in the "Integrations" category ? |
@ardatan I know this is closed, but I came across this recently and did a little digging and just wanted to confirm. graphql-yoga/packages/graphql-yoga/src/plugins/use-unhandled-route.ts Lines 55 to 56 in eca7cd1
Is there any reason that these calls couldn't be changed to: !url.pathname.endsWith(args.graphqlEndpoint) &&
!url.pathname.endsWith(`${args.graphqlEndpoint}/`) && Reason being right now I don't really have a custom graphql endpoint, it's still the default of I would expect |
But this is an assumption, when you provide |
The following code example returns 404 when querying
/api/v1/graphql
:However, it works with the following:
If this is the expected behavior, we should document it 📖
The text was updated successfully, but these errors were encountered: