• Resolved Jenish Shrestha

    (@jenish11)


    I am using WordPress and Next js with Apollo client.

    I have a custom post type in WordPress named Work.

    If I query in graphql IDE like: work(id: “slug-of-page”, idType: SLUG) {},its giving me exact data.

    But apollo client returns null data.

    If i use workBy(uri: “uri-of-page”) {} instead, apollo client returns data properly.

    I am confused on where to ask help for this.

Viewing 1 replies (of 1 total)
  • Plugin Author Jason Bahl

    (@jasonbahl)

    @jenish11 the {$postType}By (in your case workBy) field has been deprecated for quite some time.

    If you want to query a post of a custom post type by uri, you can do so with:

    
    {
      work( id:"/path/to/post" idType: URI ) {
        id
        ...otherFields
      }
    }
    
    • This reply was modified 3 years, 8 months ago by Jason Bahl.
Viewing 1 replies (of 1 total)
  • The topic ‘Apollo client’ is closed to new replies.