So I set up the graphql server described here
Now, I want to generate android queries against this server using apollo android as per these instructions.
I've tried different folder configurations for the location of the generated schema against this sample server and no matter what I do I get an error at compile time saying "GraphQL schema file should contain a valid GraphQL introspection query result"
Any advice?
GraphQL introspection enables you to query a GraphQL server for information about the underlying schema. This includes data like types, fields, queries, mutations, and even the field-level descriptions.
Having GraphQL introspection in production is usually not considered a vulnerability by itself. Sometimes it makes sense to have it if the API is public and is meant to be used by developers outside of your organization. For private APIs, however, it might expose sensitive information and expand the attack surface.
Due to its strong type system, GraphQL gives you the ability to query and understand the underlying schema. Thus, the Introspection feature allows you to query the schema and discover the available queries, mutations, subscriptions, types and fields in a specific GraphQL API.
Your GraphQL server uses a schema to describe the shape of your available data. This schema defines a hierarchy of types with fields that are populated from your back-end data stores. The schema also specifies exactly which queries and mutations are available for clients to execute.
Turns out the solution is to use the apollo-codegen cli command and not apollo schema:download
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With