graphql-guard v2.0.0 Release Notes

Release Date: 2020-04-20 // over 1 year ago
    • 👍 Added: support for graphql gem version >= 1.10 with Interpreter. #39
    • 🚚 Removed: support for previous graphql gem versions. #39

    💥 Breaking changes:

    • 💎 Requires using graphql gem version >= 1.10.0 with Interpreter.

    Before:

    class Schema < GraphQL::Schema
      query QueryType
      mutation MutationType
    
      use GraphQL::Guard.new
    end
    

    After:

    class Schema < GraphQL::Schema
      use GraphQL::Execution::Interpreter
      use GraphQL::Analysis::AST
    
      query QueryType
      mutation MutationType
    
      use GraphQL::Guard.new
    end
    
    • 📇 Use the actual type in the Policy object without type.metadata[:type_class].

    Before (with graphql gem version >= 1.8 and class-based type definitions):

    class GraphqlPolicy
      def self.guard(type, field)
        RULES.dig(type.metadata[:type_class], field)
      end
    end
    

    After:

    class GraphqlPolicy
      def self.guard(type, field)
        RULES.dig(type, field)
      end
    end
    

Previous changes from v1.3.1

    • 🛠 Fixed: compatibility with graphql gem version 1.10. #36