Skip to content

[v3] express.use() on custom path does not work without setting graphqlEndpoint  #1901

@charlypoly

Description

@charlypoly

The following code example returns 404 when querying /api/v1/graphql:

const app = express();

const yoga = createYoga({
	schema: // ...
});

app.use(`/api/v1/graphql`, yoga);

However, it works with the following:

const app = express();

const yoga = createYoga({
    graphqlEndpoint: `/api/v1/graphql`,
	schema: // ...
});

app.use(`/api/v1/graphql`, yoga);

If this is the expected behavior, we should document it 📖

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions