decapi icon indicating copy to clipboard operation
decapi copied to clipboard

add MutationField and QueryField to limit field's visibility on either just mutation or query

Open capaj opened this issue 4 years ago • 0 comments

usage would be

  @MutationField({ castTo: GroupModelAsAdmin })
  async group(
    @Arg({ type: PositiveInt }) id: number,
    @Context ctx: UserSessionContext
  ) {
    return ctx.organisation
      .$relatedQuery<GroupModelAsAdmin>('groups')
      .findById(id)
  }

capaj avatar Apr 30 '20 10:04 capaj