Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix resolve menu language field throwing internal error #15

Closed
wants to merge 1 commit into from

Conversation

liogate
Copy link

@liogate liogate commented Mar 29, 2021

Hi 👋

I've been stuck on language field too.

Here is a fix for this issue 👇
#3

@liogate
Copy link
Author

liogate commented Mar 29, 2021

@rburgst This is removing only errors thrown by graph resolver.
I think there is still an issue on apply filters wpml_element_language_details receiving wrong object ?
Or
When your menu item is from menu which inherits other lang, you'll get the parent one...

{
  menuItems {
    nodes {
      menu {
        node {
          language
        }
      }
    }
  }
}

👉 I'll get always fr...

image

@rburgst
Copy link
Owner

rburgst commented Apr 2, 2021

Sorry for not coming back earlier. I will test your patch and will come back next week with the results.

@rburgst
Copy link
Owner

rburgst commented Apr 9, 2021

Hi
I checked your patch and while it does remove the error, I do get errors when running the default gatsby query

query NODE_LIST_QUERY($first: Int!, $after: String) {
  menus(first: $first, after: $after) {
    nodes {
      databaseId
      language
      locations
      
      __typename
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}

=>

{
  "errors": [
    {
      "debugMessage": "Function name must be a string",
      "message": "Internal server error",
      "extensions": {
        "category": "internal"
      },
      "locations": [
        {
          "line": 5,
          "column": 7
        }
      ],
      "path": [
        "menus",
        "nodes",
        0,
        "language"
      ]
    },
    {
      "debugMessage": "Function name must be a string",
      "message": "Internal server error",
      "extensions": {
        "category": "internal"
      },
      "locations": [
        {
          "line": 5,
          "column": 7
...

rburgst added a commit that referenced this pull request Apr 9, 2021
@rburgst
Copy link
Owner

rburgst commented Apr 9, 2021

I have taken your idea and made it also work with the menu query shown above, see 71c4e10

@rburgst rburgst closed this Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants