0

Has anyone used this GraphQL Laravel Library before?

I managed to get it working on my local machine. But when I deploy it to Heroku, I keep getting an error that my schema is not loaded.

How do I resolve this?

Here's a screenshot of my local GraphQL environment:

Screenshot of Local GraphQL

You may find the Heroku GraphQL Playground here.

I can't find much documentation on deploying GraphQL in PHP/Laravel online.

Thank you in advance for your help.

Edit:

Here is my schema:

"A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`."
scalar DateTime
    @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime")

"Indicates what fields are available at the top level of a query operation."
type Query {
    "Gets a page."
    pages(
        "Filters by name. Accepts SQL LIKE wildcards `%` and `_`."
        name: String @where(operator: "like")
    ): [Page!]! @paginate(defaultCount: 1)

    "Gets a list of posts."
    posts(
        "Filters by featured property."
        featured: Boolean
        "Filter a single post by the slug"
        slug: String
    ): [Post!]!
        @paginate(defaultCount: 10)
        @orderBy(column: "published_at", direction: DESC)
}

"A page of the blog."
type Page {
    "Unique primary key."
    id: ID!
    "Name of the page. Used for filters"
    name: String!
    "Title of the page."
    title: String!
    "Subtitle of the page."
    subtitle: String
    "Head title of page."
    metaTitle: String
    "Head description of page."
    metaDescription: String
}

"A blog post."
type Post {
    "Unique primary key."
    id: ID!
    "Post's name. Used for filters."
    name: String!
    "Post's slug. Used for filters."
    slug: String!
    "Post's title."
    title: String!
    "Post's subtitle."
    subtitle: String
    "Post's short description."
    summary: String
    "Post's content."
    text: String
    "Post's head title."
    metaTitle: String
    "Post's head description."
    metaDescription: String
    "The date the post was published."
    publishedAt: DateTime
}

Here are my Heroku configs:

Heroku Env Vars 1 Heroku Env Vars 2

Davina Leong
  • 737
  • 2
  • 11
  • 28

1 Answers1

0

Lighthouse is working fine. I think you have Introspection disabled on production, thats why GraphqlPlayground fails.

enter image description here

Enzo Notario
  • 639
  • 4
  • 9