Mock graphql server schema (for testing) from an endpoint?

I was reading this:

Which seems to say (like graphql-tools) that you build mock typeDefs/resolvers on the client. Is there anything out there that can pull in typeDefs from a graphql endpoint (like graphiql does)? My concern is trying to keep the server/client typeDefs in sync across a huge application. Also, I have to go dig into server code to get the typeDefs out to paste them into the client code (for stories or tests).

@abhiaiyer are you aware of any way to do this? Seems like I’ll have to go copy paste server code into my client code? I can see how mocking typeDefs on the client is important, especially when you’re working on a new feature with no real graphql endpoint behind it.

" How to mock a GraphQL server from a Introspection

The next part of the series shows you the alternative way of creating a mocked GraphQL server by using the GraphQL schema from the actual GraphQL server. Therefore, you don’t need to reconstruct the exact schema as you did before. However, the GraphQL schema from the server must be accessible for you in order to pull this off. The common way to retrieve the schema is a GraphQL introspection. In case of GitHub’s GraphQL API, you could perform a HTTP GET request against their GraphQL endpoint to retrieve their schema (see instructions). However, there exists a convenient helper function to retrieve the schema with one asynchronous function call: introspectSchema."

unfortunately the example above doesn’t work and there is virtually no (updated) information anywhere about how to do this.