-
Notifications
You must be signed in to change notification settings - Fork 233
Resolving type, need data that I don't have #361
Comments
If I had this, then I could make Statamic, a wicked CMS built on Laravel, also support GraphQL. This is needed because the items in a row are defined elsewhere and I don't have enough information in that |
AFAIK the types are "maked" via Laravel, i.e. you can inject any dependency you want via the constructor; did you give this a try? |
Sorry, I'm not explaining myself very well. This is for Statamic. The data definitions are not fixed, so I need a generic solution. Here's an example definition (called a fieldset) of a User:
And here's what the corresponding data looks like:
Each fieldset can have various fields, each site is different. There are a fixed number of fields, include two that are "lists", The challenge is, when I resolved the Row, I don't have access to the "fieldset" to get the list fields for that row. HEre's my UserType:
Because in the RowType
I need to have the list of fields, which I don't. I can't pass it in the constructor because I don't know it there, and data type might have multiple grids, each with different kinds of rows (different fields). If the Sorry if that's not clear, this is hard to write out clearly. |
Sorry if this is in the docs somewhere I looked and didn't see anything. Also looked to see if there was an issue for this.
I have a custom type
Row
that needs some data/config for theattributes
to work:I need the
$this->fields
to be passed in during instantiation of the RowType. But I don't see in the parent object how to pass this in. This is how it's set in the parent, as part of thefields()
call:in here:
The text was updated successfully, but these errors were encountered: