Skip to content

v2.0.0

Compare
Choose a tag to compare
@github-actions github-actions released this 03 Jan 22:00
· 59 commits to main since this release
c662421

Major Changes

  • dc1d95f: Implement imperative configuration

    With imperative configuration, there is no need for type definition and schema modification.

    const permissions = {
      Query: {
        '*': 2, // default value for all queries
        getAnotherUser: 5 // custom value for specific query
      },
      Mutation: {
        '*': 1 //default value for all mutations
      }
    }
    const { validation } = createValidation({ permissions })
    
    const schema = buildSchema(/* GraphQL */ `
      type Query {
        getUser: User
        getAnotherUser: User
      }
      type User {
        name: String
      }
    `)

    When the permissions key is passed to configuration, schema directives will be ignored.

  • fccb773: Change function signature, make it use a single config object