Sha256: 4447488bf6b67b5bfcfc5cf301305f59a0fde79bd835690dc3826ef65a278acf
Contents?: true
Size: 807 Bytes
Versions: 56
Compression:
Stored size: 807 Bytes
Contents
# frozen_string_literal: true module GraphQL module StaticValidation module DirectivesAreDefined def initialize(*) super @directive_names = context.warden.directives.map(&:graphql_name) end def on_directive(node, parent) if !@directive_names.include?(node.name) @directives_are_defined_errors_by_name ||= {} error = @directives_are_defined_errors_by_name[node.name] ||= begin err = GraphQL::StaticValidation::DirectivesAreDefinedError.new( "Directive @#{node.name} is not defined", nodes: [], directive: node.name ) add_error(err) err end error.nodes << node else super end end end end end
Version data entries
56 entries across 56 versions & 1 rubygems