-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Change default value for BUTLER_GRAPHQL_NAMESPACE.
The value of the `BUTLER_GRAPHQL_NAMESPACE` environment variable is used when resolving graphql queries, mutations and types. The default value for this namespace is prefixed by `\\`. When this library resolves a query from the container it resolves object with the `\` prefix included. The problem arises when you try to bind or resolve something in the container using `ExampleQuery::class` as this does not use `\` as a prefix. Example: The namespace in our config is `\App\Http\Graphql` and we are trying to resolve the `Example` query. This library will resolve `\App\Http\Graphql\Example` in the container. We need to inject a specific instance of a class to the constructor of the query so we declare the following: ``` $app->when(Example::class)->needs(Dep::class)->give(...) ``` `Example::class` will expand to `App\Http\Graphql\Example`. Because this doesn't match `\App\Http\Graphql\Example`, the binding won't work. This commit changes the default namespace in the config to use the standard format in php.
- Loading branch information
1 parent
785558c
commit 44348b1
Showing
4 changed files
with
5 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters