Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jschoba opened this issue Oct 1, 2024 · 0 comments
Open
Labels
(u) GraphQL Issues specific to the GraphQL support.

Comments

@jschoba
Copy link

jschoba commented Oct 1, 2024

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!
}

@ygrik ygrik added the (u) GraphQL Issues specific to the GraphQL support. label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
(u) GraphQL Issues specific to the GraphQL support.
Projects
None yet
Development

No branches or pull requests

2 participants