Coder Social home page Coder Social logo

Comments (9)

jasonbahl avatar jasonbahl commented on June 17, 2024 2

This has been resolved for quite some time.

To reproduce:

Add ACF Field

I created an ACF Field of the "Post Object" field type, and set it to allow multiple selections

Screen Shot 2021-05-14 at 3 31 17 PM

Edit Post with Field

Then I edited a post with this field on it, selecting multiple post objects

Screen Shot 2021-05-14 at 3 31 51 PM

Query the field

Then I queried the field:

v0.5.2

In WPGraphQL for ACF v0.5.2, I queried like so:

{
  post(id: 2179, idType: DATABASE_ID) {
    id
    databaseId
    postTest {
      multiSelectPostObjectField {
        __typename
        ... on Post {
          id
          title
        }
      }
    }
  }
}

Screen Shot 2021-05-14 at 3 29 52 PM

v0.6.0

The upcoming v0.6.0 (#262) is making some changes to the behavior with the Post Object field type, so it can be queried like so:

{
  post(id: 2179, idType: DATABASE_ID) {
    id
    databaseId
    postTest {
      multiSelectPostObjectField {
        nodes {
          __typename
          id
          databaseId
        }
      }
    }
  }
}

Screen Shot 2021-05-14 at 3 34 04 PM

from wp-graphql-acf.

cordial avatar cordial commented on June 17, 2024

Is anyone looking at this? I'm also having this issue.

from wp-graphql-acf.

cordial avatar cordial commented on June 17, 2024

I've actually done a (pretty obvious) workaround in case anyone sees this. Just put a single post object into a repeater. Works fine.

from wp-graphql-acf.

weareimpulse avatar weareimpulse commented on June 17, 2024

I have been having the same issue, I have a group of fields exposed to GraphQL, each field in the group is a Post Object field type allowing multiple id's to be stored, when accessing this user meta via GraphQL the query always returns null, at this point I can't change the fields as per @cordial suggested above as we are to far into the dev process to change this, has anybody got round this issue or looking into it as it is blocking further development on this area of the project.

Thanks for your time. Charlie

from wp-graphql-acf.

ProwlElement avatar ProwlElement commented on June 17, 2024

im having the same issue i have a repeater field that I want to be able to add multiple "Project" custom post types using Post Object and all I can see is
{ pages { nodes { featuredProjects { projectCards { fieldGroupName } } } } }

expected
{ pages { nodes { featuredProjects { projectCards { project { title image location } } } } } }

This should give me access to the post object and i should be able to use it this way or am I missing something?

Any help appreciated.
Thanks,
S

from wp-graphql-acf.

ProwlElement avatar ProwlElement commented on June 17, 2024

https://www.wpgraphql.com/extenstion-plugins/wpgraphql-for-custom-post-type-ui/

I just found this

from wp-graphql-acf.

cordial avatar cordial commented on June 17, 2024

Does using a repeater not work for you or fit your needs? My workaround, described above fixed my issue which looks the same as yours (i couldnt find a way of fixing it the original way that worked).

from wp-graphql-acf.

ProwlElement avatar ProwlElement commented on June 17, 2024

I got it working using the above plugin
S

from wp-graphql-acf.

cordial avatar cordial commented on June 17, 2024

Ah ok, cool!

from wp-graphql-acf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.