GraphQLError {{message:“语法错误:预期名称,发现为Int” 30807695“”,

时间:2019-08-16 15:26:01

标签: apollo express-graphql

我正在使用crypto-js散列数据,并通过阿波罗角度将其发送到express-graphql。

我尝试使用toString()方法将其作为字符串发送,即使异步,它也会失败100分之90,等待返回空字符串。然后将对象分成两个变量,一个作为int数组,第二个作为int。没有成功,因为即使接受的查询类型为Int,它仍然会显示相同的错误。还尝试使它的字符串数组即使typeof是string,graphql也会将其识别为int。

阿波罗突变:

return this.apollo.mutate<Query>({
      errorPolicy: 'all',
      mutation: gql`
       mutation Mutation{
       signUp(words:${words},sigBytes:${sigBytes})
 }`
    });

阵列的架构类型:

 type Crypto{
    words: Int!
    }
type Mutation {
 signUp(words: [Crypto] ,sigBytes: Int!): Int,
}

所有单词作为字符串的模式类型:

signUp(words: String! ,sigBytes: Int!): String,

预期的输出是发送整个数据以表示将其解密。

只有此错误:

GraphQLError {message: "Syntax Error: Expected Name, found Int "-379818220"",

0 个答案:

没有答案