因此,我有以下路由:/creator/item和/creator/item/price。这两个路由的模式都有一个称为updateOne的突变。但是,当我调用/creator/item/price的路由时,它与/creator/item匹配。
这是故意的吗?是否有解决办法,或者我必须为它创建一个完全唯一的路径名?
发布于 2019-02-27 17:41:39
看起来定义的顺序很重要。
之前:
// - item
const item_schema =
require("./graphql/creator/items")
app.use(
"/creator/item",
graphqlHTTP({
schema:
item_schema,
graphiql:
env !== "production",
formatError
})
)
const item_price_schema =
require("./graphql/creator/item/prices.js")
app.use(
// "/creator/updateOne/price",
"/creator/item/price",
graphqlHTTP({
schema:
item_price_schema,
graphiql:
env !== "production",
formatError
})
)之后:
const item_price_schema =
require("./graphql/creator/item/prices.js")
app.use(
// "/creator/updateOne/price",
"/creator/item/price",
graphqlHTTP({
schema:
item_price_schema,
graphiql:
env !== "production",
formatError
})
)
// - item
const item_schema =
require("./graphql/creator/items")
app.use(
"/creator/item",
graphqlHTTP({
schema:
item_schema,
graphiql:
env !== "production",
formatError
})
)https://stackoverflow.com/questions/54902042
复制相似问题