如何拦截graphql-compose-mongoose模式创建以在输入中添加参数

时间:2018-11-09 09:34:10

标签: graphql-compose-mongoose

我想在graphql-compose-mongoose的updateOne查询中添加一个参数。我看到有一个生成的输入类型: UpdateOneComplaintInput

complaintUpdateOne:  Resolver {
  name: 'updateOne',
  displayName: 'Complaint.updateOne',
  parent: null,
  kind: 'mutation',
  description:
   'Update one document: 1) Retrieve one document via findOne. 2) Apply updates to mongoose document. 3) Mongoose applies defaults, setters, hooks and validation. 4) And save it.',
  type: TypeComposer { gqType: UpdateOneComplaintPayload },
  args:
   { record: { type: UpdateOneComplaintInput! },
     filter:
      { type: FilterUpdateOneComplaintInput,
        description: 'Filter by fields' },
     sort: { type: [EnumTypeComposer] },
     skip: { type: 'Int' } },
  resolve: [Function: resolve] }

在架构创建过程中如何交织并修改该输入?

阅读源代码后,我到达了可以调用composeWithMongoose(scheam,{schemaComposer:OwnSC})的地步(知道OwnSC的类型为server / node_modules / graphql-compose / lib / SchemaComposer.d.ts)

这对我来说很复杂

0 个答案:

没有答案