Commit graph

384 commits

Author SHA1 Message Date
Zach Daniel
1b8136212d chore: reintroduce work lost in a bad rebase 2024-07-18 13:32:25 -04:00
Zach Daniel
a659ff4693 improvement: add extension installation code 2024-07-18 13:30:29 -04:00
Rebecca Le
4f0d508a3e
chore: Wording tweaks to installer content (#193) 2024-07-16 06:03:36 -04:00
Zach Daniel
88735868cc chore: put playground above base 2024-07-15 20:46:03 -04:00
Zach Daniel
01ca76da70 improvement: add igniter-backed installer 2024-07-15 14:25:40 -04:00
Barnabas Jovanovics
d47ab78747
fix: use checked constraints (#187) 2024-07-01 09:25:38 -04:00
Zach Daniel
2a2af45230 improvement: add nullable_fields? for easily marking fields as nullable
test: update tests to use this to illustrate field policy behavior
2024-07-01 09:25:14 -04:00
Zach Daniel
53b3fbd699 chore: small reorg of functions 2024-07-01 08:39:56 -04:00
Zach Daniel
8d612a08bc chore: ensure managed relationship types are distinct on identifier 2024-06-22 12:29:36 -04:00
Zach Daniel
b1ab52959d fix: don't assume filter is non-nil for gets 2024-06-21 15:11:22 -04:00
Zach Daniel
0292ef1db8 improvement: only define managed_relationship mutations when necessary 2024-06-18 08:59:10 -04:00
Zach Daniel
eac844186a fix: properly interpolate action in conflict messages 2024-06-17 20:00:54 -04:00
Zach Daniel
e51bad36d5 chore: format 2024-06-17 09:21:13 -04:00
Barnabas Jovanovics
77f09b2422
fix: add resource query to action struct (#178) 2024-06-11 11:55:00 -04:00
Barnabas Jovanovics
8089164d74
feat: argument_input_types (#176)
* feat: argument_input_types

* use mix task to update formatter.exs

* update CheatSheet
2024-06-10 13:32:37 -04:00
Zach Daniel
b399d06a86 chore: use parens to remove warning in 1.17
closes #175
2024-06-10 09:10:34 -04:00
Zach Daniel
2aab03b0cc fix: better type handling around empty types 2024-06-04 09:24:31 -04:00
Zach Daniel
60f3fd8f99 fix: don't generate empty input objects for embeds 2024-06-04 00:49:17 -04:00
Zach Daniel
d49fc5a488 fix: honor read_action for update/destroy mutations
closes #169
2024-06-02 11:28:06 -04:00
Riccardo Binetti
62940c31ec
feat: relationship pagination (#166) 2024-05-26 09:50:54 -04:00
Zach Daniel
a6ca7fea67 feat: support queries/mutations on the domain 2024-05-24 15:51:19 -04:00
Riccardo Binetti
31d29e178f
improvement: deduplicate map types across domains (#164)
Allow having common NewType maps that are used in multiple domains and are
correctly deduplicated
2024-05-23 12:11:28 -04:00
Col
7ec1cfe84e
improvement: Implement AshGraphql.Error for Ash.Error.Query.ReadActionRequiresActor (#154) 2024-05-23 08:58:58 -04:00
Riccardo Binetti
2bc7b78aa6
fix: don't deduplicate argument types by argument name (#162)
As mentioned in the upgrade guide, the point of dropping auto generation of
types was avoiding conflicts when two arguments had the same name but different
types. Now that we require explicit generation, we can actually support that
usecase for, e.g., arguments with the same name but different types in
create/update mutations.
2024-05-23 08:58:25 -04:00
Barnabas Jovanovics
90df75015e
handle empty primary key (#160) 2024-05-21 08:14:23 -04:00
Barnabas Jovanovics
bf6ef37b8f
fix: use Ash.EmbeddableType.ShadowDomain (#156) 2024-05-14 06:16:56 -04:00
Zach Daniel
896d76420b fix: accepted attributes don't have to be public? 2024-05-11 18:25:23 -04:00
Zach Daniel
761a60f3b4 chore: add an experimental auto_import_types? option to use AshGraphql
this is to solve a very specific technical issue around conflicts with
using `import_types` on your schema, and having conflicts with a named type
you already have defined, and the types we import
2024-05-11 18:24:58 -04:00
Alan Heywood
7386a5b627
improvement: make mutation result errors list non-nullable (#144)
* chore: regenerate cheat sheets

* improvement: make mutation result errors list non-nullable
2024-05-03 21:57:02 -04:00
Josh Price
c015030dc5
docs: minor doc updates (#142) 2024-05-01 16:45:20 -04:00
Zach Daniel
0e79680681 docs: documentation overhaul 2024-05-01 15:59:38 -04:00
Riccardo Binetti
833c1d5143
feat: allow passing custom descriptions to queries and mutations (#138)
Close #137
2024-04-29 15:01:26 -04:00
Zach Daniel
019632c420 fix: properly set actor on bulk action calls 2024-04-27 09:27:00 -04:00
Zach Daniel
fb74c2a4f3 improvement: use bulk actions for create/destroy 2024-04-25 23:28:37 -04:00
Zach Daniel
84b86e65be improvement: add graphql_define_type?/1 callback for graphql types 2024-04-24 09:21:26 -04:00
Zach Daniel
4c0ed1160c chore: fix credo warning 2024-04-24 09:00:56 -04:00
Zach Daniel
e60c0def27 fix: don't process maps with no fields 2024-04-24 08:49:53 -04:00
Zach Daniel
ee43ec4a26 fix: tag union values with their type before casting 2024-04-23 19:54:00 -04:00
dependabot[bot]
df04981d49
chore(deps): bump ash from 3.0.0-rc.6 to 3.0.0-rc.18 (#127)
* chore(deps): bump ash from 3.0.0-rc.6 to 3.0.0-rc.18

Bumps [ash](https://github.com/ash-project/ash) from 3.0.0-rc.6 to 3.0.0-rc.18.
- [Changelog](https://github.com/ash-project/ash/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ash-project/ash/compare/v3.0.0-rc.6...v3.0.0-rc.18)

---
updated-dependencies:
- dependency-name: ash
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: Fix dialyzer error.

`action.accept` can no longer ever be `nil`.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: James Harton <james@harton.nz>
2024-04-22 09:31:33 +12:00
Zach Daniel
bd9562a9fa fix: ensure type is set when using find_manage_relationship
closes #132
2024-04-20 16:24:05 +01:00
Zach Daniel
1c4cf1969c fix: properly honor new pagination config everywhere
fixes #130
2024-04-20 16:18:52 +01:00
Zach Daniel
1331bdd4ce improvement: support generic actions with no return type 2024-04-11 13:11:37 -04:00
Zach Daniel
10fa6b2ff7 chore: format 2024-04-04 21:45:33 -04:00
Zach Daniel
2552f07689 fix: accept input object for destroy mutations 2024-04-03 10:19:13 -04:00
Zach Daniel
d692c931c2 chore: format 2024-04-01 16:16:05 -04:00
Zach Daniel
180d05545c improvement!: auto? managed_relationships by default
imporovement!: remove deprecated configuration
2024-04-01 16:02:30 -04:00
Zach Daniel
349086fbb8 improvement!: No longer automagically derive types 2024-04-01 15:27:43 -04:00
Zach Daniel
78c5b6a3bb chore: update errors and deps 2024-04-01 14:13:48 -04:00
Riccardo Binetti
513c1ac68f
improvement!: port AshGraphql to Ash 3.0 (#123)
Step 1: update Ash

Step 2: mass rename Api to Domain

Step 3: Ash.Query.expr -> Ash.Expr.expr

Also change ref interpolation

Step 4: remove all warnings

Step 5: remove registries from tests

Step 6: fix filter

Step 7: private? -> !public?

Step 8: Ash.Calculation -> Ash.Resource.Calculation

Step 9: use depend_on_resources/1 -> resources/1

Step 10: add Domain to all resources

Step 11: use Ash module for all actions

Step 12: add public? true all around

Step 13: remove verbose? from options passed during Domain calls

Step 14: add simple_sat

Step 15: Ash.ErrorKind is no more, so remove code from errors

Step 16: sprinkle default_accept :* around tests

Step 17: replace Ash.Changeset.new/2 with Ash.Changeset.for_*

Step 18: calculation fixups

- Context is now a struct and arguments go under the arguments key
- Function based calculations receive a list of records
- Add a select to query-based loads
- select -> load

Step 19: pass the correct name to pass the policy in tests

Step 20: Ash.Query.new/2 is no more

Step 21: add AshGraphql.Resource.embedded? utility function

Use that instead of Ash.Type.embedded_type?(resource_or_type) since resources
are not types anymore

Step 22: handle struct + instance_of: Resource in unions

Resources are not type anymore so they need to be passed this way in unions

Step 23: ensure we only check GraphQL actions for pagination

All reads are now paginated by default, so this triggered a compilation error

Step 24: swap arguments for sort on calculations

Step 25: remove unused debug? option
2024-04-01 14:03:06 -04:00
Riccardo Binetti
9674614b62
feat: allow resources without types (#121)
* fix: regenerate spark formatter and cheatsheet

Make CI pass again

* feat: allow resources without types

Ensure they only expose generic action queries. Add checks to ensure that either
`type :resource_type` or `generate_object? false` is passed if it's needed.

Close #119
2024-03-28 11:16:32 -04:00