2

i have this ,

  @Roles(ROLES.ADMIN)
  @ResolveField('product', () => String)
  async getProduct(@Parent() product: Product) {
    return this.productService.getProduct(product);
  }


i already add fieldResolverEnhancers: ['guards'] in appModule my graphQl request gives me an error

     "message": "Forbidden resource",
      "path": [
        "user",
        "product"
      ],

witch is the expected behavior , what i need is that the request succeed ,but return null as product value if Role !== ADMIN

any suggestions ? thanks

0 Answers0