Documentation issue?

Hello !
I have an issue filtering contents through links using the code example proposed on the documentation. When I make the request like presented in the docs (here):

    client.getEntries({
        content_type: env.CTF_PRODUCT_TYPE_ID,
        linking_field: 'fields.categories.sys.id',
        target_entry_id: '7LAnCobuuWYSqks6wAwY2a'
    })

The response request is the following one:

Error: Request failed with status code 400
    at createError (contentful.js:1894)
    at settle (contentful.js:4125)
    at XMLHttpRequest.handleLoad (contentful.js:1734)

After some research, the filtering is working when constructing the query like so:

      client.getEntries({
        content_type: env.CTF_PRODUCT_TYPE_ID,
        'fields.categories.sys.id': '24DPGBDeGEaYy8ms4Y8QMQ'
      })

So I’m wondering, have I made a mistake ? In that case would somebody be kind enough to point it at me =D ? Or is the mistake inside the docs and who should I ping to get the doc fixed ?

1 Like

Hi Felix,
linking_field is not supposed to be a valid key, but should be substituted by the dot-notation key. Which is a bit confusing here.
I will fix that asap

Best,
Khaled

3 Likes

Thanks for the quick reply !

So the way I’m doing it the right one ?

Hi @felix.denoix,

So, yeah, you should be good to go!
Let us know if need any further assistance with this :wink: