Closed tjbp closed 3 years ago
This is a good use case for a custom resolver. If you still want to use the regular relationship handling provided by lighthouse you may want to use a directive instead on top or other directives like @create
. I don't think everyone needs this so it does not fall under the scope of the package. Thank you for the issue and let me know if there is anything else i can help with.
Would it be considered within the scope of this package to support Eloquent relationships inside the Register mutation?
I ask primarily because the Register mutation is likely to be the most widely-used method for user record creation in a project, so being able to populate relationships in a single query would be useful. As an example, if I was to add the
groups
field below to the Register input type:I would expect the above to behave like Lighthouse and detect that
groups
is a relationship on the Auth model and create a connection between the two records. Currently it seems the Register resolver is only compatible with standard mass-assignable attributes.I appreciate that a custom resolver could be created for this purpose, or shall I create a pull request (if mimicking Lighthouse is desirable)?