graphql-client icon indicating copy to clipboard operation
graphql-client copied to clipboard

Allow load_schema to accept an IO

Open Aupajo opened this issue 3 years ago • 0 comments

dump_schema accepts IO objects (Pathname, StringIO, etc.) but load_schema does not.

This results in some surprising behaviour:

schema_cache = Pathname('schema-cache.json')

# This works
GraphQL::Client.dump_schema(..., schema_cache)

# This doesn't, until now
GraphQL::Client.load_schema(schema_cache)

This PR fixes the discrepancy.

Aupajo avatar Jul 13 '21 05:07 Aupajo