Permission Denied

Here
I’m executing one graphQL query with faunaDB and appear the error like “Permission Denied”. Even I give the all permission from the permission section of faunaDB dashboard

Here is the error Screenshot:

Here is my schema:

# However, FaunaDB automatically adds two private values: _id and _ts
type ShopUser {
  first_name: String!
  last_name: String!
  email: String!
  account_owner: String!
  locale: String!
  collaborator: Boolean!
  email_verified: Boolean!
  # _id: Generated by FaunaDB as each document's unique identifier
  # _ts: Timestamp generated by FaunaDB upon object creation
}

type Shop {
  domain: String!
  token: String!
  user: ShopUser!
  createdAt: Time!
  # _id: Generated by FaunaDB as each document's unique identifier
  # _ts: Timestamp generated by FaunaDB upon object creation
}

type ShopCollection {
  shop_collection_id: Long!
  title: String!
  automated_max_products: Int!
  type: String!
  has_autoshffle: Boolean!
  base_rules: String!
  status: String!
  shop_domain: String!
  createdAt: Time!
  # _id: Generated by Fauna as each document's unique identifier
  # _ts: Timestamp generated by Fauna upon object updating
}

# A query named 'entries' which returns an array of GuestbookEntry objects
# Implicit arguments: _size (count) and _cursor (location within the Index)
type Query {
  allShops: [Shop!]!
  allShopCollections(shop_domain: String!): [ShopCollection!]!
  shopByDomain(domain: String!): [Shop!]
}

@cnviradiya are you including the authorization header in the request?

Yes, already added authorization header with admin key too

It looks likes your requests have good tokens and are going to the right endpoint.

If you don’t provide the header, you get the message, “Missing authorization header.”

If you connect to the incorrect Region Group then you get the message, “Invalid database secret.”

Your schema should have generated a allShopCollections Index that you need read permission to, as well as read permission for the ShopCollection Collection. I believe that should be it.

If you are trying with an admin key and still receiving the “Permission Denied” error, then I am not sure what is happening.

Can you share the relevant code setting up your requests, so that we can get a better look into the finer details?

Hi @cnviradiya. Have you been able to figure this out? Let us know if we can still help. Cheers!

Thanks for solution @ptpaterson . Let me try this solution and get back to you

Thanks @ptpaterson
This is already fixed. It’s related to the key issue with permission region

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.