graphql-guard v2.0.0 Release Notes

Release Date: 2020-04-20 // about 2 years 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