#Access to GraphQL client session
1 messages · Page 1 of 1 (latest)
Do I need to re-create the connection?
If you kill the connection everything is lost.
How are you trying to use the gql_schema?
Actually I don't need GraphQL schema. It's just I don't understand how to call my module functions
If I try to call it via select + execute (as how core functions work) I'm getting AttributeError AttributeError: Field MyModule does not exist in type Query.
You mean the query builder?
Yeah, this is related to https://github.com/dagger/dagger/issues/7182. Need to make this easy, but don't have time to look into the third-party library to update the schema. One option there would be to disable that schema validation potentially.
Thank you very much!
Will try to disable schema validation for the moment
You'll need to fork though, since that call is made by the Python SDK without a config option.
It's kind of scary to fork Pyhton SDK 🙂
Maybe I can monkey-patch validation?
Maybe you can try re-fetching the schema.
gql_client = (await dag._ctx.conn.session.get_session()).client
await gql_client.fetch_schema()
The issue above is about making that gql_client more easily accessible, like perhaps:
await dag._gql_client.fetch_schema()
Wait, I think it makes more sense to share the gql session rather than the gql client. The latter is available from the former anyway.
Try this:
gql_session = await dag._ctx.conn.session.get_session()
await gql_session.fetch_schema()
I think it works!
The graphql schema is updated and I can see my module functions
Great! 🎉
Thank you very much ❤️🔥