express-graphql-匹配父路由的子路由

时间:2019-02-27 09:27:17

标签: javascript node.js graphql graphql-js express-graphql

所以我有以下路线:/creator/item/creator/item/price。两条路由的两种模式都有一个称为updateOne的变异。但是,当我调用/creator/item/price的路由时,它将匹配/creator/item

这是故意的吗?是否有解决方法,或者我必须为其创建一个完全唯一的路径名?

1 个答案:

答案 0 :(得分:0)

似乎定义顺序很重要。

之前:

Application.Wait Now + #12:00:06 AM#

IE.Visible = True

'IE.document.getElementById("fileOnlineReturnTaxType").Value = "EVR"

'IE.document.getElementsByName("taxType").Value = "84"

   'Set oSelect = IE.document.getElementById("fileOnlineReturnTaxType")
    '    oSelect.Focus
     '   oSelect.selectedIndex = 1
      '  oSelect.FireEvent "onchange"

 'IE.document.getElementById("fileOnlineReturnTaxType").Click


  'Set Link3 = IE.document.getElementsByTagName("span")

   ' For Each t In Link3
          ' If t.innerText = "Select a tax type..." Then
          ' MsgBox (t.innerText)
           '   t.Click
            '  Exit For
           'End If
          'Next t

之后:

// - 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
    })
)