Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Conjunction always using AND inside Condition Groups

Open
#54 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
graphql, php
Domain
api, backend

Research direction

Start by reproducing the supplied GraphQL query with the Scenario 1–3 variables and compare the results. Trace how ConditionGroupInput conjunction is applied within and between the listed groups; done means Scenario 3 combines the two groups with OR and returns the expected union rather than zero results.

Written by the indexing model from the issue text.

Description

Hello,

Looks like conjunction inside just below Condition Groups is always taking AND, irrespective of conjunction supplied.

Main Query

query ($key: [String]!, $offset: Int!, $limit: Int!, $filters: ConditionGroupInput, $sort: [SortInput]) {
      searchAPISearch(index_id: "myindex", condition_group: $filters, range: {offset: $offset, limit: $limit}, fulltext: {keys: $key}, sort: $sort) {
        count: result_count
        documents {
          ... on MyindexDoc  {
            group__title
            content__content_title
          }
        }
      }
    }

Scenario 1 : Supplied query variables (giving expected result)

{
  "offset": "0",
  "limit": 50,
  "key": "test",
  "filters": {
    "conjunction": "OR",
    "groups": [
      { 
        "conditions": [
          {
            "operator": "=",
            "name": "content__content_type",
            "value": "article"
          },
          {
            "operator": "=",
            "name": "content__field_is_application",
            "value": "yes"
          },
          {
            "operator": "<>",
            "name": "content__field_life_cycle__entity__name",
            "value": "Retired"
          }
        ]
      }
    ]
  },
  "sort": [
    {
      "field": "search_api_relevance",
      "value": "desc"
    }
  ]
}

Scenario 2 : Supplied query variables (giving expected result)

{
  "offset": "0",
  "limit": 50,
  "key": "test",
  "filters": {
    "conjunction": "OR",
    "groups": [
      {
        "conditions": [
          {
            "operator": ">",
            "name": "group__id",
            "value": "0"
          },
          {
            "operator": "<>",
            "name": "group__field_life_cycle__entity__title",
            "value": "Retired"
          },
          {
            "operator": "<>",
            "name": "group__field_is_live",
            "value": "0"
          }
        ]
      }
    ]
  },
  "sort": [
    {
      "field": "search_api_relevance",
      "value": "desc"
    }
  ]
}

Scenario 3 : Supplied query variables (giving 0 result, but it should be result of Scenario 1 + Scenario 2)

{
  "offset": "0",
  "limit": 50,
  "key": "test",
  "filters": {
    "conjunction": "OR",
    "groups": [
      { 
        "conditions": [
          {
            "operator": "=",
            "name": "content__content_type",
            "value": "article"
          },
          {
            "operator": "=",
            "name": "content__field_is_application",
            "value": "yes"
          },
          {
            "operator": "<>",
            "name": "content__field_life_cycle__entity__name",
            "value": "Retired"
          }
        ]
      },
      {
        "conditions": [
          {
            "operator": ">",
            "name": "group__id",
            "value": "0"
          },
          {
            "operator": "<>",
            "name": "group__field_life_cycle__entity__title",
            "value": "Retired"
          },
          {
            "operator": "<>",
            "name": "group__field_is_live",
            "value": "0"
          }
        ]
      }
    ]
  },
  "sort": [
    {
      "field": "search_api_relevance",
      "value": "desc"
    }
  ]
}

What I assume conjunction just above groups always using AND operation between groups objects, but I want to use OR here.
Am I doing something wrong?

Dominant language
PHP
Stars
10
Forks
24
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from drupal-graphql/graphql-search-api

All issues in drupal-graphql/graphql-search-api

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.