Skip to main content
Andris Sevcenko's user avatar
Andris Sevcenko's user avatar
Andris Sevcenko's user avatar
Andris Sevcenko
  • Member for 10 years, 6 months
  • Last seen more than 2 years ago
awarded
awarded
awarded
comment
How do I write a GraphQL query to search through sub-entries/entries as fields and return the whole entry?
My apologies. I had both over-analyzed and under-analyzed what the argument handler should accomplish here. It still extends the base relational argument handler class, since we want the built-in capability of resolving nested relational arguments there, but the handleArgument method already returns the specific element ids we're after. I rewrote the class to fit the purpose and tested it. You can find it here: I rewrote that one file here: gist.github.com/andris-sevcenko/…
awarded
comment
How do I write a GraphQL query to search through sub-entries/entries as fields and return the whole entry?
Something like $relatedIds = MatrixBlock::find()->select('ownerId')->column(); should return what you're after. (MatrixBlock should be an alias of \craft\elements\MatrixBlock).
comment
How do I write a GraphQL query to search through sub-entries/entries as fields and return the whole entry?
Just a custom argument handler. The ids you return (provided you extend the RelationArgumentHandler class) are going to get included in the relatedTo argument. So, run your search based on the argument value. That will get you entry ids. Since Craft doesn't have the concept of reverse relations, you'll have to do another search to find the Matrix Blocks that are related to the entries with the ids you have. After that, you should return the ids of all the Matrix Blocks and, as they get rolled in the relatedTo argument, you get a list of the entries related to the Matrix Blocks.
Loading…
awarded
awarded
comment
Craft 2 to Craft 3 upgrade: User Photos not migrated to User Accounts
@Green17 that migration was pretty and not very reversible. The only way to re-do it would be to re-upgrade.
awarded
awarded
awarded
reviewed
Approve
reviewed
Approve
reviewed
Approve
revised
Correct IAM settings for Amazon S3 bucket
Changed policy to reflect current AWS syntax requirements.
Loading…
awarded
comment
An unknown error has occurred in asset reindex
I mean when you run the indexing process, your Craft install fires a bunch of Ajax requests to the server to try to index the files. Can you check the response body of those requests? If all seems normal, maybe enable devMode and try again.
1
2 3 4 5
10