Heroku 上未加载 GraphQL 架构
GraphQL Schema not Loaded on Heroku
有人用过这个GraphQL Laravel Library吗?
我设法让它在我的本地机器上运行。
但是当我将它部署到 Heroku 时,我不断收到一个错误,提示我的架构未加载。
我该如何解决这个问题?
这是我本地 GraphQL 环境的屏幕截图:
您可能会找到 Heroku GraphQL 游乐场 here。
我在 PHP/Laravel 网上找不到很多关于部署 GraphQL 的文档。
预先感谢您的帮助。
编辑:
这是我的架构:
"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
}
这是我的 Heroku 配置:
Lighthouse 工作正常。我认为您在生产中禁用了内省,这就是 Graphql Playground 失败的原因。
有人用过这个GraphQL Laravel Library吗?
我设法让它在我的本地机器上运行。 但是当我将它部署到 Heroku 时,我不断收到一个错误,提示我的架构未加载。
我该如何解决这个问题?
这是我本地 GraphQL 环境的屏幕截图:
您可能会找到 Heroku GraphQL 游乐场 here。
我在 PHP/Laravel 网上找不到很多关于部署 GraphQL 的文档。
预先感谢您的帮助。
编辑:
这是我的架构:
"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
}
这是我的 Heroku 配置:
Lighthouse 工作正常。我认为您在生产中禁用了内省,这就是 Graphql Playground 失败的原因。