You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It might be useful/necessary for some users to have classes that belong to the same group of functionality (e.g. Models, Queries) split across multiple namespaces.
The current default namespaces allow defining only one namespace though.
Let's discuss if multiple default namespaces are common enough to warrant the extra complexity and if we want to implement them, how we should go about it.
Pro's
Convenient short definitions
Enables grouping files by domain instead of function
Con's
Extra complexity in the implementation without actually adding new functionality
Possible source of bugs/ambiguity when you have the same class in different namespaces
Goes against the Laravel-like default of grouping files by function, e.g. all Models in one directory
Points to discuss
Should this be possible only for Models or for other default namespaces too?
Can this only be done in lighthouse.php or is it also possible through @group?
The text was updated successfully, but these errors were encountered:
If the resolving process where can be really complex, users can rebind some of the classes that are used for resolving the namespace in Lighthouse, or just redefine the default directive (can be done with #441)
But, basically let user define the namespace option as an array is the fastest way to achieve their purpose (at their own risk).
When I was trying to get this to work, I found that the code base only queries for the default model namespace in two methods. In each of those methods, it puts [ ] around namespaces value and tries to resolve the model in multiple namespaces.
I have been using this in my own app and it is working pretty well. I have over 60 models and my code isn't using the default Laravel directory structure so something like this is a must.
@sadnub has expressed interest in this feature.
It might be useful/necessary for some users to have classes that belong to the same group of functionality (e.g. Models, Queries) split across multiple namespaces.
The current default namespaces allow defining only one namespace though.
Let's discuss if multiple default namespaces are common enough to warrant the extra complexity and if we want to implement them, how we should go about it.
Pro's
Con's
Points to discuss
lighthouse.php
or is it also possible through@group
?The text was updated successfully, but these errors were encountered: