Comments (7)
I think a new verb would work well, specifically a read_one
to contrast a get
. get
uses an identity whereas read_one
simply expects the query to return one result (using Api.read_one/2
)
from ash_graphql.
I'll leave a note here shortly with some implementation tips, would be very grateful to have you PR it.
from ash_graphql.
So step 1 will be to add an entity to the DSL. You can model it off of get
, but it just won't take an identity
option.
https://github.com/ash-project/ash_graphql/blob/master/lib/resource/resource.ex#L7
You'll need to add code to determine the query type: (same as get
)
https://github.com/ash-project/ash_graphql/blob/master/lib/resource/resource.ex#L562
You'll need to configure it to accept the read_args
, but not the identity like get
does:
https://github.com/ash-project/ash_graphql/blob/master/lib/resource/resource.ex#L580
And then you'll need to add a resolver for :read_one
:
https://github.com/ash-project/ash_graphql/blob/master/lib/graphql/resolver.ex#L6
I think that should be it.
from ash_graphql.
#13 not sure if there is any testing or other documentation you would want me to add on this
from ash_graphql.
If you could add a test in read_test.exs
that would be great :D
from ash_graphql.
test added
from ash_graphql.
Released in 0.14.0
from ash_graphql.
Related Issues (20)
- Validation errors should include a path
- Unable to update calculation type with attribute_types HOT 2
- Make some standard fields non nullable HOT 8
- Load relationships from custom queries HOT 1
- Better error for typos in Aggregates when using AshGraphQL
- Allow giving a description to enum values created with Ash.Type.Enum HOT 2
- Type should be optional for resources that only expose generic actions HOT 3
- Assume that all `manage_relationship` types should have types automatically derived for them HOT 1
- Nested queries and mutations
- Remove auto types for everything except `Ash.Type.Enum` and `Ash.Type.NewType` HOT 1
- Keyset pagination - aggregate field must be included in query when sorting on that field HOT 3
- Keyset pagination - field must be included in query when sorting on that field HOT 1
- Return %Ash.Error.Forbidden{} if FieldPolicy fails HOT 6
- Error when sorting on aggregate that is not included in query HOT 2
- Ambiguous call to relationships HOT 8
- Arguments of relationship read action in nested query are not present in preparation HOT 2
- When a graph query has no arguments, I expect the `Ash.Query` object (as visible via the `prepare` function in the DSL) to have an empty map. HOT 3
- Error defining an aggregate of a calculation HOT 2
- UTC timestamps are improperly formatted (bug) HOT 1
- Add support for Relay refetching (Relay-compliant IDs and the `Node` query) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ash_graphql.