Skip to content

Graphql | Conflict between site and language parameters #422

@Aku-benj

Description

@Aku-benj

Describe the bug

I have an issue where if I query a navigation via Graphql with a site and language parameters,
the language param seems to make the site param useless.

Here are my sites :
Image
And in the multisite version :
Image

Here is my test query :

query getNav {
	mainNavigation: navigationNodes(
	   site: "mainSiteFr"
       	   nav: "navMain"
      	   level: 1
      	   language: "en"
       ) {
		url
		title
		classes
		element {
			slug
		}
	}
}

And the result contains only the navigation Nodes of the mainSiteEn website.
In that context, I expect and empty Result because the site mainSiteFr does not have the en language.

MultiSite version:

query getMainNav {
	mainNavigation: navigationNodes(site: "frSite1", nav: "navMain", level: 1, language: "fr") {
		url
		title
		classes
		element {
			slug
		}
	}
}

In a multisite context, this is even worse because the result comes from a different site in the same language.

Steps to reproduce (reproduce from screenshot above)

  1. Create 2 sites with different languages
  2. Create a navigation with some nodes on both sites
  3. Use the above gql query

Steps to reproduce Multisite (reproduce from screenshot above)

  1. Create 2 groups of 2 sites with same languages
  2. Create a navigation with some nodes on both sites
  3. Use the above gql query

Craft CMS version

5.6.11

Plugin version

3.0.6

Multi-site?

Both yes and no

Additional context

I have the headlessMode active in craft general.php, not sure if it matters

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions