Laravel graphql lighthouse not working properly

Laravel graphql lighthouse not working properly


0

I am using GraphQL Lighthouse for Laravel 10 project for the first time and I stuck in first phase of api.

I exactly do what documentation said Link Here and YouTube tutorial

  • Install lighthouse package

    composer require nuwave/lighthouse

  • Publish the default schema

    php artisan vendor:publish –tag=lighthouse-schema

  • IDE Support

    php artisan lighthouse:ide-helper

  • Install GraphQL DevTools

    composer require mll-lab/laravel-graphiql

After that when I hit my project e.g.

https://localhost/laravel-light-graph/graphiql

It gives me this error:

{
  "errors": [
    {
      "message": "Unexpected token '<', "<!DOCTYPE "... is not valid JSON",
      "stack": "SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON"
    }
  ]
}

Laravel graphql lighthouse not working properly

Note: I install this package on fresh Laravel

I didn’t write a single line of code for create apis or schema and can’t go further from documentation.

I don’t know what to do, I searched a lot but didn’t get any help. So please guide me on this.

Thanks a lot.

2

  • Can you pls use your browser inspection tool and check the request to see what exception is thrown?

    – mostafa

    53 mins ago

  • dev.laravel-light-graph.test/graphql 403 (Forbidden) … and when I check the source, it shows empty

    – deemi-D-nadeem

    40 mins ago


Load 4 more related questions


Show fewer related questions

0



Leave a Reply

Your email address will not be published. Required fields are marked *