Giter VIP home page Giter VIP logo

Comments (13)

JasonTheAdams avatar JasonTheAdams commented on July 20, 2024 1

For some reason csrf_token() is returning empty/null so the meta content is empty. The token is working everywhere outside of GraphQL Playground. Did I miss something in your steps?

Edit: I needed to enable the web middleware to the config for this package. I'm still unable to get the @auth directive to work, though, but that may be out of the scope of this issue.

from laravel-graphql-playground.

spawnia avatar spawnia commented on July 20, 2024

Is there any reason not to enable CSRF? We might just add it in statically.

Not too sure about the request.credentials, why is that needed?

from laravel-graphql-playground.

olivernybroe avatar olivernybroe commented on July 20, 2024

Well In cases where you don't use CSRF, I think it might fail when trying to generate the token? Not really sure about it as I always use CSRF.

The request.credentials with same-origin defines if it should pass the headers from the current request to all request it makes to graphql. This is needed to pass the cookies header with session id to all request to graphql

from laravel-graphql-playground.

spawnia avatar spawnia commented on July 20, 2024

Looks like Laravel includes it by default, so i think we should do the same. It can be removed from the published view file if it is not wanted. Can you send a PR?

I enhanced the README with some info about how to add arbitrary settings. I don't want to duplicate all the settings in the config file, as it would be hard to maintain.

from laravel-graphql-playground.

olivernybroe avatar olivernybroe commented on July 20, 2024

@spawnia Ah sure, let's do that then.
I'll first be able to make a PR in a couple of days, else I don't mind that you do it :)

from laravel-graphql-playground.

spawnia avatar spawnia commented on July 20, 2024

@olivernybroe nah i am good with waiting 😉

from laravel-graphql-playground.

JasonTheAdams avatar JasonTheAdams commented on July 20, 2024

@olivernybroe Any progress on this? We would also benefit from being able to authenticate via session, and I'm not sure I have as strong a grasp as you do as to what's necessary.

from laravel-graphql-playground.

olivernybroe avatar olivernybroe commented on July 20, 2024

@JasonTheAdams yeah sorry, I really haven't had time and forgot all about this.
If anybody else wants to then please create the pr :)

Hmm sounds wierd, did you change the init config?

from laravel-graphql-playground.

JasonTheAdams avatar JasonTheAdams commented on July 20, 2024

@olivernybroe Yeah, I changed the init config. The token is displaying by this point, but I found that this package view triggers a different session than the one otherwise used for the other pages. Pretty strange.

from laravel-graphql-playground.

spawnia avatar spawnia commented on July 20, 2024

Open for PR's.

from laravel-graphql-playground.

JasonTheAdams avatar JasonTheAdams commented on July 20, 2024

@spawnia If I can figure out how to get it to use the same session then I'll definitely look to submit a PR. If you can give me a lead of any kind I would appreciate it. I'm not sure how Laravel determines which session to use during a request.

from laravel-graphql-playground.

JasonTheAdams avatar JasonTheAdams commented on July 20, 2024

So I was actually about to make a PR for this. Then I realized that the view can be published and overwritten with exactly these details. Seems like that may be an adequate solution?

from laravel-graphql-playground.

Empereol avatar Empereol commented on July 20, 2024

So I was actually about to make a PR for this. Then I realized that the view can be published and overwritten with exactly these details. Seems like that may be an adequate solution?

@JasonTheAdams , could you expand on this? I have published the graphql-playground view but still cannot get any query with @auth to work correctly.

from laravel-graphql-playground.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.