Closed daef closed 1 year ago
Hi. I assume I would have to create account to access the metadata. Could you store the JSON somewhere and provide link? So I can use it for testing.
how can i save the json?
It's actually a GraphQL query that the generator queries the API to get the metadata:
query IntrospectionQuery {
__schema {
queryType { name }
mutationType { name }
subscriptionType { name }
types {
...FullType
}
directives {
name
description
locations
args {
...InputValue
}
}
}
}
fragment FullType on __Type {
kind
name
description
fields(includeDeprecated: true) {
name
description
args {
...InputValue
}
type {
...TypeRef
}
isDeprecated
deprecationReason
}
inputFields {
...InputValue
}
interfaces {
...TypeRef
}
enumValues(includeDeprecated: true) {
name
description
isDeprecated
deprecationReason
}
possibleTypes {
...TypeRef
}
}
fragment InputValue on __InputValue {
name
description
type { ...TypeRef }
defaultValue
}
fragment TypeRef on __Type {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
}
}
}
}
}
}
}
With the query at hand it's easy :) schema.json.txt
Why not add a --export-schema-json to the tool?
Pushed new package versions.
Why not add a --export-schema-json to the tool?
The tool is generator primarily. And even though it includes fetching of the metadata I don't think it should be its scope.
Yes, but I guess problems with the metadata primarily arise during generation and then the tool choking on the input could replicate its own request. Maybe better call the flag --generate-debug-info to make it clear.
When I generate the client for shopify (their schema can be found here ) the method WithProductVariantsBulkUpdateUserErrorFragment gets generated twice. It works when I remove one of the two identical implementations, but it's irritating to have to manually edit that 120k likes file after each update.
Any ideas how I could avoid this problem?