Skip to content

GraphQL display problem Error: Body must be a string. Received: undefined #2687

@jschoba

Description

@jschoba

Bug description

GraphQL API is not displayed in the Self-hosted developer portal, we got a loading sign which never stops.

Reproduction steps

  1. Import Synthetic GraphQL API with sample schema
  2. Open Graph QL API in developer portal
  3. Nothing is displayed on the page

Expected behavior

A javascript exception is displayed:
Error: Body must be a string. Received: undefined.
at devAssert (webpack://apim-developer-portal/./node_modules/graphql/jsutils/devAssert.mjs?:9:11)
at new Source (webpack://apim-developer-portal/./node_modules/graphql/language/source.mjs?:33:99)
at new Parser (webpack://apim-developer-portal/./node_modules/graphql/language/parser.mjs?:84:94)
at parse (webpack://apim-developer-portal/./node_modules/graphql/language/parser.mjs?:31:16)
at Module.buildSchema (webpack://apim-developer-portal/./node_modules/graphql/utilities/buildASTSchema.mjs?:101:77)
at GraphDocService.eval (webpack://apim-developer-portal/./src/components/operations/operation-details/ko/runtime/graphql-documentation/graphql-doc-service.ts?:66:40)
at Generator.next ()
at fulfilled (webpack://apim-developer-portal/./src/components/operations/operation-details/ko/runtime/graphql-documentation/graphql-doc-service.ts?:5:58)

Is self-hosted portal?

Yes

Release tag or commit SHA (if using self-hosted version)

release tag2.27

Environment

azure static web app

Additional context

Example Schema that we used:

type User {
id: ID!
username: String!
email: String!
createdAt: String!
reservations: [Reservation!]!
}

type Reservation {
id: ID!
userId: ID!
startDate: String!
endDate: String!
status: String!
createdAt: String!
user: User!
}

type Query {
users: [User!]!
user(id: ID!): User
reservations: [Reservation!]!
reservation(id: ID!): Reservation
}

type Mutation {
createUser(username: String!, email: String!): User!
createReservation(userId: ID!, startDate: String!, endDate: String!, status: String!): Reservation!
updateReservation(id: ID!, startDate: String, endDate: String, status: String): Reservation!
deleteReservation(id: ID!): Boolean!
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    (u) GraphQLIssues specific to the GraphQL support.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions