2
我使用graphql继电器,我的项目GraphQL继电器返回一条记录
当我grapgql运行此查询:
{
viewer{
boRelayCustomerInfo(_id:"59267769de82262d7e39c47c") {
edges {
node {
id
}
}
}
}
}
我给了这个错误: "message": "arraySlice.slice is not a function"
我的查询代码:
import {
GraphQLID,
GraphQLNonNull,
} from 'graphql'
import {
connectionArgs,
connectionFromPromisedArray,
} from 'graphql-relay'
import { customerConnection } from '@/src/schema/type/customer/CustomerType'
import { CustomerModel, ObjectId } from '@/src/db'
export default {
type: customerConnection.connectionType,
args: {
...connectionArgs,
_id: {
type: new GraphQLNonNull(GraphQLID),
},
},
resolve: (_, args) => connectionFromPromisedArray(
CustomerModel.findOne({_id: ObjectId(args._id)}),
args,
),
}
请告诉我们,如何只返回一个re在继电器的绳子。