Skip to content
This repository was archived by the owner on Feb 10, 2019. It is now read-only.

Fix bug that middleware not work when not using default prefix and default schema #333

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

ghost
Copy link

@ghost ghost commented Apr 30, 2018

Follow Issue #332

I'm not sure I should change the routes file or controller.
But I think that there will be only one schema per request, so I just change the routes.php.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 70.537% when pulling 2cdcec3 on BinotaLIU:patch-fix-332 into 171631a on Folkloreatelier:develop.

@mfn
Copy link

mfn commented Jun 28, 2018

This change doens't look right. prefix is working fine for me.

Can you elaborate more what your problem is and what it does fix?

@ghost
Copy link
Author

ghost commented Jun 29, 2018

@mfn as I mentioned in #332, if you changed the prefix, the middleware will not work.

A simple instruction to reproduce that:

  1. change the prefix to something else like _
  2. create a Query test, which only return Boolean(true).
  3. add \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode middleware in config('graphql.middelware_schema.default')
  4. run artisan down
  5. run graphql request /_/default with query
    query test {
      test
    }

Expected result is an HTTP 503 error, but the middleware will not work, so we got the result we wrote in the graphql query, which is { test: true }

@MNF
Copy link

MNF commented Jun 29, 2018

@binotaliu , you misspelled the name and should address the comment to @mfn

@ghost
Copy link
Author

ghost commented Jun 29, 2018

@MNF sorry for disturb you. i have edited my comment. you can click unsubscribe from the right bar to unsubscribe from future updates.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants