2016-07-25 21 views

回答

0

我不確定在聲明枚舉值時使用'/'是可能的。

嘗試切換「狗/貓」的名稱,如「動物」

0

財產以後你不能在GraphQL的enum一個特殊字符。但是您可以使用解析器處理它們 - 除非您在GraphQL中無法解決Type的問題,您只能解析Type的field

例如,

type Foo { 
    test: Test 
} 
enum Test { 
    ABC 
    Dog 
    DogCat 
} 

,並在您解析爲Foo

{ 
    Foo: { 
    test({ test }) { 
     // handle special characters and return enum supported string 
     if (test === "Cat/Dog") return "CatDog"; 
     return test; 
    } 
    } 
}