An internal server error occurred. Please contact Fauna support

Hello there,

I am using the sample database that comes with Fauna account and trying to query an existing collection managers. I keep getting the error below. Is anything going wrong? This is happening continuously since morning.

An internal server error occurred. Please contact Fauna support.

query getAllManagers {
  managers{
    data {
      firstName
    }
  }
}

While the demo data (which can be included when you create a new database) does have a managers collection, the demo GraphQL schema does not specify a managers type. You would have to update the schema with a managers type before your query would work.

I’m not sure why you’re getting the “internal server error”. When I run your query against a fresh database that has the demo data, the response is:

{
  "data": null,
  "errors": [
    {
      "message": "Cannot query field 'managers' on type 'Query'. (line 2, column 3):\n  managers {\n  ^",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ]
    }
  ]
}

You didn’t say how you are running your query. Are you using the GraphQL Playground (in the Dashboard)? If not, do you have the correct GraphQL endpoint specified in your GraphQL client?

1.I am using the GraphQL playground in the dashboard. The forum software doesn’t allow for more than one screenshot.

  1. I also tried using the GraphQL endpoint and I get site cannot be reached.

  2. Do you mean I should replace the existing schema which comes with the demo data? Do you have the sample schema.gql file for managers that I can use? Also is there any documentation on this?
    BTW, I get the same error when querying all the demo collections (customers, managers, orders etc).

Hi @dsharmet.

You should be able to use the following schema. Importing it with Replace mode in the playground may fix the issue.

type Store @collection(name: "stores") {
  name: String!
  address: Address
}

type Product @collection(name: "products") {
  name: String!
  description: String!
  price: Float!
  store: Store!
  quantity: Int!
  backorderLimit: Int!
  backordered: Boolean!
}

type Customer @collection(name: "customers") {
  firstName: String!
  lastName: String!
  address: Address!
  telephone: String!
  creditCard: CreditCard!
}

type Order @collection(name: "orders") {
  customer: Customer!
  cart: [ProductCart!]!
  status: String!
  creationDate: Time!
  shipDate: Time
  shipAddress: Address!
  creditCard: CreditCard!
}

type Address @embedded {
  street: String
  city: String
  state: String
  zipCode: String
}

type CreditCard @embedded {
  network: String!
  number: String!
}

type ProductCart @embedded {
  product: Product!
  quantity: Int!
  price: Float!
}

input SubmitOrderProductInput {
  productId: ID!
  quantity: Int!
}

type Query {
  allStores: [Store!]! @index(name: "all_stores")
  allProducts: [Product!]! @index(name: "all_products")
  allCustomers: [Customer!]! @index(name: "all_customers")
  allOrders: [Order!]! @index(name: "all_orders")
}

type Mutation {
  submitOrder(customerId: ID!, products: [SubmitOrderProductInput]): Order! @resolver(name: "submit_order")
}
1 Like

Since your screenshot showed a query to the US region group, you might be encountering a networking issue that prevents you from accessing the GraphQL API endpoint for the US region group. To test connectivity, try this:

$ curl https://graphql.us.fauna.com/ping
Up and running!

If you see any other output than Up and running!, the service may not be operational or accessible.

Note that the schema that @ptpaterson provided is the demo schema; it does not include a managers type.

You could add the following lines to the schema and then import the schema into your database:

type Managers @collection(name: "managers") {
  firstName: String!
  lastName: String!
  address: Address!
  telephone: String!
}

Note that I capitalized the Managers, so you’d need to adjust your query accordingly.

Coverage of the schema import modes is available here: How to access GraphQL endpoints | Fauna Documentation

1 Like

FYI: I’ve filed an issue (FE-1806) requesting that the demo GraphQL schema be updated to be as consistent as possible with the demo FQL schema.

1 Like