Closed geekscrapy closed 2 years ago
could you try running https://github.com/profusion/sgqlc/blob/master/examples/github/update-schema.sh? I just executed it and it's working properly
btw, the schema.docs.graphql
is not an executable document, the sgqlc-codegen operation
expects an executable document, see examples:
these are either query
, mutation
or subscription
.
Last but not least, I never saw a server without @include
and @skip
because they are listed as recommended in the https://spec.graphql.org/June2018/#sec-Type-System.Directives
GraphQL implementations should provide the @skip and @include directives.
Ahh I think I get it now. Very. Very. Very new to GraphQL!
could you try running https://github.com/profusion/sgqlc/blob/master/examples/github/update-schema.sh? I just executed it and it's working properly
This works fine. It worked ok for me before 👍
btw, the
schema.docs.graphql
is not an executable document, thesgqlc-codegen operation
expects an executable document, see examples:
- https://github.com/profusion/sgqlc/blob/master/examples/github/sample_operations.gql
- https://github.com/profusion/sgqlc/blob/master/examples/shopify/shopify_operations.gql
these are either
query
,mutation
orsubscription
.
I think I know the use of the .gql file now, so thanks. I missed it as I was reading the DSL demo you have on the README page as part of the previous section (creating the schema) as there is a print of the query :) maybe you could add the filename to the top of that example DSL (sample_operations.gql
)?
Last but not least, I never saw a server without
@include
and@skip
because they are listed as recommended in the https://spec.graphql.org/June2018/#sec-Type-System.DirectivesGraphQL implementations should provide the @Skip and @include directives.
There's always exceptions 😅 The query I'm running (which works with my server) is below. How much will this break if I use it?! The includes are for convenience for --exclude-deprecated
--exclude-description
, yes?
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 {
name
description
args {
...InputValue
}
type {
...TypeRef
}
isDeprecated
deprecationReason
}
inputFields {
...InputValue
}
interfaces {
...TypeRef
}
enumValues {
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
ofType {
kind
name
}
}
}
}
}
}
}
}
I think I know the use of the .gql file now, so thanks. I missed it as I was reading the DSL demo you have on the README page as part of the previous section (creating the schema) as there is a print of the query :) maybe you could add the filename to the top of that example DSL (sample_operations.gql)?
Where in the docs you want me to clarify the filename? If you can provide a patch, even better!
There's always exceptions 😅 The query I'm running (which works with my server) is below. How much will this break if I use it?! The includes are for convenience for --exclude-deprecated --exclude-description, yes?
correct, these are to save server and network from useless data, it basically means "do not/do include" that field based on a runtime value, as opposed as to generate a specific query for each. You can use any introspection query and it can include or not the deprecated/descriptions as you wish. Just the structure must be the standard query, as you did.
Where in the docs you want me to clarify the filename? If you can provide a patch, even better!
Smallest ever PR incoming
correct, these are to save server and network from useless data, it basically means "do not/do include" that field based on a runtime value, as opposed as to generate a specific query for each. You can use any introspection query and it can include or not the deprecated/descriptions as you wish. Just the structure must be the standard query, as you did.
Sweet, thanks again
thank you, it's integrated as #192
I tried with a private graphql instance which doesn't have
$include
directive so it spits out variations of the following error:Unknown directive "@include"
. I managed to hack at the query to remove these directives and got a schema.To make sure I was doing it correctly, I tried to replicate the commands in the README however that wasn't successful either. When using the following commands and downloading the SDL from below, I get the following error:
validation failed: list index out of range at schema.docs.graphql:1:1