0

I need to fetch a schema from graphQL API endpoint. So the result must be a string like:

  type User {
    id: ID!
    name: String!
  }

  type Home {
    user: User!
    address: String
    country: String!
  }

  type Query {
    MyUsers: User!
  }

Is it possible to do by using codegen?

podeig
  • 2,597
  • 8
  • 36
  • 60

1 Answers1

1

It really depends on the GraphQL server you are using, Some GraphQL servers provide a GraphQL Explorer. The GraphQL Explorer is a page where you can manually input GraphQL queries into the page such as Graphiql

Other way is to try out graphql-cli you can do with the below command,

get-graphql-schema ENDPOINT_URL -j > schema.json
Sajeetharan
  • 216,225
  • 63
  • 350
  • 396