View Source Spark.Dsl.Fragment (spark v1.1.44)

Allows splitting up a DSL into multiple modules, potentially organizing large DSLs

Use the of option to expression what your fragment is a fragment of. You can add extensions as you would normally to that resource, and they will be added to the parent resource.

defmodule MyApp.Resource.Graphql do
  use Spark.Dsl.Fragment, of: Ash.Resource, extensions: AshGraphql.Resource

  graphql do
    ...
  end
end