⚠️
This is the documentation for the old GraphQL Mesh version v0. We recommend upgrading to the latest GraphQL Mesh version v1.
Migrate to GraphQL Mesh v1
Migrate to GraphQL Mesh v1
Operation Field Permissions
You can use @graphql-mesh/plugin-operation-field-permissions
plugin to restrict the scope of
certain public API users to a subset of the public GraphQL schema.
Based on Envelop’s useOperationFieldPermissions
This plugin and authentication on a plugin or source level are complementary. See authentication guide for more details.
Getting Started
npm i @graphql-mesh/plugin-operation-field-permissions
Example Configuration
.meshrc.yaml
# ...
plugins:
- operationFieldPermissions:
permissions:
- if: 'context._auth0?.sub != null'
allow:
- '*'
Config API Reference
permissions
(type:Array of Object
):if
(type:String
)allow
(type:Array of String
)