Skip to content

MetaQuery is not added when connection dynamically built with wp-graphql-facewp #31

@veepdotai

Description

@veepdotai

When using FacetWP + wp-graphql-facewp, I have the following pseudo connection:

query GetVcontentsByFacet {
  postFacet {
   facets {
     label
     name
     type
   }
    
  posts(where: {metaQuery: {
    	relation: OR,
    	metaArray: [
        	{
             key: "tvfCategory",
             value: "Marketing",
             compare: LIKE,
           },
           {
             key: "tvfCategory",
             value: "Test",
             compare: LIKE,
           },        
  		]
  	}
  }) {
    edges {
      node {
        id
        tvfCategory
      }
    }
  }
  }
}

The postFacet is created dynamically.

In posts inside postFacet, I don't have meta query as indicated in the result:

{
  "errors": [
    {
      "message": "Field \"metaQuery\" is not defined by type PostFacetToPostConnectionWhereArgs; Did you mean dateQuery?",
      "extensions": {
        "category": "graphql"
      },
      "locations": [
        {
          "line": 9,
          "column": 17
        }
      ]
    },

But I have it in RootQuery.posts.

It seems wp-graphql-meta-query doesn't see the dynamically created connection PostFacetToPostConnectionWhereArgs.

Any ideas to fix this?

Thanks,

JC

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions