-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
load_introspection_from_server does not use custom headers #25
Comments
Similar issue - pointing the |
After editing the source files in my virtualenv to accept my custom headers I ran into this. I don't know much about GraphQL, but is there a valid reason for a static code generator to be able to access http servers to gather more info about schemas? Can you have an offline mode where I don't have to access external schema endpoints and provide authentication information? |
@P6rguVyrst I think the reasonj why they need your graphql endpoint is not to access the schema, It's supposed to work with a file. def load_introspection_from_file(filename):
with open(filename, 'r') as fin:
return json.load(fin)
def load_schema(uri):
introspection = load_introspection_from_file(uri) if os.path.isfile(uri) else load_introspection_from_server(uri)
return build_client_schema(introspection) But because they also want to provide a configured client ready to use for later (with the given graphql endpoint) in the generated code. Anyway it looks like the project has been deserted. I wonder if this was because they were a major flaw in the way it is supposed to work, or just because they move on something else. In the later case I could be interested to continue the work one day, I like the idea a lot. It reminds me https://github.com/honza/anosql (but better thanks to the generated dataclass) for graphql. |
Hello I'm trying to test gql but running
gql run
returnedI suspect the cause is that the custom headers are not used to load the schema from the configured endpoint.
Here is what my
.gql.json
look likes:The text was updated successfully, but these errors were encountered: