{"record":{"id":"80cfe48ab5619615","repo":"theforeman/foreman","slug":"global-id-for-taxonomy-name-filter-is-for-other","errorCode":null,"errorMessage":"Global ID for #{taxonomy_name} filter is for other graphql type (expected '#{taxonomy_name}', got '#{type_name}')","messagePattern":"Global ID for #(.+?) filter is for other graphql type \\(expected '#(.+?)', got '#(.+?)'\\)","errorType":"validation","errorClass":"GraphQL::ExecutionError","httpStatus":null,"severity":"error","filePath":"app/graphql/resolvers/concerns/collection.rb","lineNumber":116,"sourceCode":"          taxonomy_ids << resolve_taxonomy_global_id(Location, location_id)\n        elsif location.present?\n          taxonomy_ids << resolve_taxonomy_name_to_id(Location, location)\n        end\n\n        if organization_id.present?\n          taxonomy_ids << resolve_taxonomy_global_id(Organization, organization_id)\n        elsif organization.present?\n          taxonomy_ids << resolve_taxonomy_name_to_id(Organization, organization)\n        end\n\n        taxonomy_ids.uniq\n      end\n\n      def resolve_taxonomy_global_id(taxonomy_class, global_id)\n        taxonomy_name = taxonomy_class.name\n        _, type_name, id = Foreman::GlobalId.decode(global_id)\n\n        raise GraphQL::ExecutionError.new(\"Global ID for #{taxonomy_name} filter is for other graphql type (expected '#{taxonomy_name}', got '#{type_name}')\") unless taxonomy_name == type_name\n\n        id.to_i\n      end\n\n      def resolve_taxonomy_name_to_id(taxonomy_class, taxonomy_name)\n        id = taxonomy_class.find_by(name: taxonomy_name)\n        raise GraphQL::ExecutionError.new(\"#{taxonomy_class.name} could not be found my name #{name}.\") unless id\n        id\n      end\n\n      class_methods do\n        def has_taxonomix?\n          self::MODEL_CLASS.include?(Taxonomix)\n        end\n      end\n    end\n  end\nend","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/theforeman/foreman/blob/6b05625475cfe6aac31a88f8c8ee6e62e4efe620/app/graphql/resolvers/concerns/collection.rb#L98-L134","documentation":"Error \"Global ID for #{taxonomy_name} filter is for other graphql type (expected '#{taxonomy_name}', got '#{type_name}')\" thrown in theforeman/foreman.","triggerScenarios":"Thrown at app/graphql/resolvers/concerns/collection.rb:116 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6b05625475cfe6aac31a88f8c8ee6e62e4efe620","analyzedAt":"2026-08-23T17:46:34.094Z","schemaVersion":2},"datasetVersion":"2026-08-23T21:17:23.414Z"}