reactioncommerce / reaction-feature-requests

Reaction Feature Requests
13 stars 1 forks source link

Fulfillment Restrictions Management Interface #130

Open ghost opened 4 years ago

ghost commented 4 years ago

Hello. New user. I wanted to add some fulfillment restrictions today. There's some reasonable documentation describing fulfillment restrictions but it falls short of explaining how to create/update a fulfillment restrictions. I ended up creating the following GQL mutation to add the record to the database:

mutation AddFlatRateFulfillmentRestriction {
  createFlatRateFulfillmentRestriction(
    input: {
        clientMutationId: "allow001",
      shopId: "mtk2iBnfB8NbuRBNA",
      restriction: {
        type: allow,
        destination: {
          country: [
            "US",
            "CA"
          ]
        }
      }
    }
  ), {
    clientMutationId
  }
}

After using hydra-token to authenticate as the admin I was able to run the above to successfully insert a record into MongoDB in the FlatRateFulfillmentRestrictions. I'm not sure if it works yet but it's in there. It would be beneficial to improve the docs and create a management interface for stuff like this considering FlatRateFullfillment is a core plugin.