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

[gatsby-transformer-json] Filter data by attribute #2430

Closed
signalwerk opened this issue Oct 12, 2017 · 3 comments
Closed

[gatsby-transformer-json] Filter data by attribute #2430

signalwerk opened this issue Oct 12, 2017 · 3 comments

Comments

@signalwerk
Copy link
Contributor

When using gatsby-transformer-json filtering an array doesn't work:

data.json

{
  "foo": [
    {
      "name": "Name 1"
    },
    {
      "name": "Name 2"
    }
  ]
}

graphQL

{
  dataJson(foo: {in: {name: {ne: "no match"}}}) {
    foo {
      name
    }
  }
}

error

{
  "errors": [
    {
      "message": "Cannot read property 'id' of undefined",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "dataJson"
      ]
    }
  ],
  "data": {
    "dataJson": null
  }
}

It's the same if the data-array has an id-attribute in the object.

gatsby v1.9.45

@signalwerk signalwerk changed the title Filter data by attribute – graphQL – transformer-json [gatsby-transformer-json] Filter data by attribute Oct 12, 2017
@Mrblcvk
Copy link

Mrblcvk commented Nov 14, 2017

Up!
Did you find a solution?

I'm having the same problem..

@signalwerk
Copy link
Contributor Author

@MarBleck nope. I didn't look into it anymore. Keep me posted if you find a solution.

@Chuloo
Copy link
Contributor

Chuloo commented Aug 29, 2018

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues as many of them have already been resolved with the latest updates or explained in a previous issue.

Feel free to open a new one if you still experience this problem or a similar one! 👍

Also, marking this as a duplicate to #3643

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

No branches or pull requests

3 participants