Skip to content
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

Return :ok from mix task #93

Merged
merged 1 commit into from
Mar 6, 2024

Conversation

cschiewek
Copy link
Contributor

@cschiewek cschiewek commented Mar 5, 2024

It's helpful to be able to generate the schema SDL as a mix compiler, but becase the success path returns true, rather then :ok, mix returns a warning:

* creating .
* creating schema.graphql
==>
warning: Mix compiler :graphql_schema_sdl was supposed to return {:ok | :noop | :error, [diagnostic]} but it returned true

This PR addresses that warning by updating write_schema/2 to return :ok.

For those curious, you can set it as a compiler by updating the alias, and compilers keys the project function in your mix.exs.

def project do
  [
    aliases: ["compile.graphql_schema_sdl": "absinthe.federation.schema.sdl --schema Schema"],
    compilers:  Mix.compilers() ++ [:graphql_schema_sdl]
  ]
end

@dantuck dantuck merged commit bd7497a into DivvyPayHQ:main Mar 6, 2024
3 checks passed
@kzlsakal kzlsakal added the bug Something isn't working label Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants