diff --git a/ci/sdk_elixir.go b/ci/sdk_elixir.go index 038abe53525..afb8e88e57b 100644 --- a/ci/sdk_elixir.go +++ b/ci/sdk_elixir.go @@ -70,14 +70,17 @@ func (t ElixirSDK) Generate(ctx context.Context) (*Directory, error) { if err != nil { return nil, err } - + introspection, err := t.Dagger.introspection(ctx, installer) + if err != nil { + return nil, err + } gen := t.elixirBase(elixirVersions[0]). With(installer). - WithExec([]string{"mix", "run", "scripts/fetch_introspection.exs"}). WithWorkdir("dagger_codegen"). WithExec([]string{"mix", "deps.get"}). WithExec([]string{"mix", "escript.build"}). - WithExec([]string{"./dagger_codegen", "generate", "--introspection", "../introspection.json", "--outdir", "gen"}). + WithMountedFile("/schema.json", introspection). + WithExec([]string{"./dagger_codegen", "generate", "--introspection", "/schema.json", "--outdir", "gen"}). WithExec([]string{"mix", "format", "gen/*.ex"}). Directory("gen") diff --git a/sdk/elixir/dagger_codegen/priv/introspection.graphql b/sdk/elixir/dagger_codegen/priv/introspection.graphql deleted file mode 100644 index d17da75f352..00000000000 --- a/sdk/elixir/dagger_codegen/priv/introspection.graphql +++ /dev/null @@ -1,99 +0,0 @@ -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 - ofType { - kind - name - } - } - } - } - } - } - } -} diff --git a/sdk/elixir/scripts/fetch_introspection.exs b/sdk/elixir/scripts/fetch_introspection.exs deleted file mode 100644 index d208ce83ff6..00000000000 --- a/sdk/elixir/scripts/fetch_introspection.exs +++ /dev/null @@ -1,4 +0,0 @@ -query = File.read!("dagger_codegen/priv/introspection.graphql") -{:ok, client} = Dagger.Core.Client.connect(connect_timeout: :timer.seconds(50)) -{:ok, resp} = Dagger.Core.Client.query(client, query) -File.write!("introspection.json", Jason.encode!(resp["data"]))