Skip to content
Snippets Groups Projects
Commit a8115fd3 authored by Brett Walker's avatar Brett Walker
Browse files

Must override == in the clas itself

GraphQL-Ruby's types used to override def ==(other),
but it doesn't anymore when using the interpreter
parent 685b382a
No related branches found
No related tags found
No related merge requests found
Pipeline #382944610 failed
Pipeline: GitLab

#382944705

    ......@@ -3,8 +3,10 @@
    module GraphQLExtensions
    module ScalarExtensions
    # Allow ID to unify with GlobalID Types
    # In particular, this effects the checks in the graphql gem,
    # graphql/static_validation/rules/variable_usages_are_allowed.rb#validate_usage
    def ==(other)
    if name == 'ID' && other.is_a?(self.class) &&
    if ['GraphQL::Types::ID', 'ID'].include?(name) && other.is_a?(self.class) &&
    other.type_class.ancestors.include?(::Types::GlobalIDType)
    return true
    end
    ......@@ -14,7 +16,8 @@ def ==(other)
    end
    end
    ::GraphQL::ScalarType.prepend(GraphQLExtensions::ScalarExtensions)
    # ::GraphQL::ScalarType.prepend(GraphQLExtensions::ScalarExtensions)
    ::GraphQL::Schema::Scalar.extend(GraphQLExtensions::ScalarExtensions)
    module Types
    class GlobalIDType < BaseScalar
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment