Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow defining default namespaces as an array #525

Merged
merged 5 commits into from Dec 27, 2018
Merged

Allow defining default namespaces as an array #525

merged 5 commits into from Dec 27, 2018

Conversation

spawnia
Copy link
Collaborator

@spawnia spawnia commented Dec 27, 2018

  • Added or updated tests
  • Added Docs for all relevant versions

Related Issue/Intent

Resolves #438
Resolves #439

Changes

From a user perspective, default namespaces can now be defined as singular strings or arrays. See:

    /*
    |--------------------------------------------------------------------------
    | Namespaces
    |--------------------------------------------------------------------------
    |
    | These are the default namespaces where Lighthouse looks for classes
    | that extend functionality of the schema. You may pass either a string
    | or an array, they are tried in order and the first match is used.
    |
    */
    'namespaces' => [
        'models' => ['App', 'App\\Models'],
        'queries' => 'App\\GraphQL\\Queries',
        'mutations' => 'App\\GraphQL\\Mutations',
        'interfaces' => 'App\\GraphQL\\Interfaces',
        'unions' => 'App\\GraphQL\\Unions',
        'scalars' => 'App\\GraphQL\\Scalars',
        'directives' => ['App\\GraphQL\\Directives'],
    ],

Breaking changes

Nope, existing configurations work as before.

@spawnia
Copy link
Collaborator Author

spawnia commented Dec 27, 2018

@chrissm79 can you please change the StyleCI setting so it commits the fixes automatically? That would prevent this merge conflict right now and make it so i do not have to go in and fix stuff manually.

Uploading image.png…

@chrissm79
Copy link
Contributor

@spawnia It's already set to do so. It took a minute for it to push a commit on my PR but it did so automatically

@spawnia
Copy link
Collaborator Author

spawnia commented Dec 27, 2018

Hm, maybe it does not work for branches in a different repo?

@chrissm79
Copy link
Contributor

Current StyleCI setting
screen shot 2018-12-27 at 11 48 01 am

@chrissm79
Copy link
Contributor

Could be, it only took a minute on my PR and the branch was created in this repo

@spawnia
Copy link
Collaborator Author

spawnia commented Dec 27, 2018

I read in the StyleCI docs, i think they will only commit fixes when merging the PR.

For this particular case, i think i will try to manually apply the patch

# Conflicts:
#	src/Schema/Directives/Fields/FieldDirective.php
#	src/Schema/Values/FieldValue.php
#	src/Support/helpers.php
#	tests/Utils/Interfaces/Nameable.php
#	tests/Utils/Scalars/Email.php
@chrissm79
Copy link
Contributor

Nice work @spawnia 👍

@chrissm79 chrissm79 merged commit d3a1686 into nuwave:master Dec 27, 2018
@spawnia spawnia deleted the default-namespaces-as-array branch December 27, 2018 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants