No Absinthe schemas generated for resource
I've been using AshGraphql just fine, having created several resources that work with it. Then today, I created a new resource, and no Absinthe schemas are created from it.
20 Replies
Here's the resource:
And here's the test that tests it:
is it in the registry?
The registry:
AbsintheSchema:
🤔 🤔
does
mix compile --force
help?I'll try that...
you shouldn't need to do that, but its good to check
Nope, didn't help
FWIW your test doesn't appear to be using the mutation name you shared w/ me
the mutation in the resource is
create_ash_venue
and the test is createVenue2
could that be related?Oh yeah, I was trying different things. Let me verify...
might also be worthwhile to load up the gql playground to see if its there just not what you expected it to be or something
I tried that too
Okay it works!
Wow. I double-checked the names, but that wasn't good enough.
classic 😆
glad its working
Thanks for checking my work!
my pleasure 😄
@Zach Daniel One question on mutations: Why is it by default that mutations return a
result
and error
field? I know there's the option to put the errors at the root level, but there must be some advantage for the default behavior.There are a couple reasons, not that they are like...huge reasons to do it this way, but its what made me choose that path
1. the errors can be typed
2. it allows us to return action specific mettadata
we solved for #2 a bit differently for read actions by creating additional types, but for mutations we add a typed
metadata
key to the result object
for example:
metadata
just tells any consumers that the action will populate some metadata on the resource, and expresses what type it will be. So with that you'll get something like RegisterResult
with types for the metadata, result and errors.
I'd like to make these things more flexible over time, kind of like what we did for relay support, to allow people to pick from a few different flavors, and to customize things more (like removing result objects)Okay, thanks for the explanation. That makes sense. I'll have to chew on that a bit. From a client-side perspective, having errors come from two different places is a lot to deal with.
yeah, I can see that. For me, I tend to treat them differently. errors that come in the response for the specific mutatiton (since you can send multiple) are usually errors I want to tell the user about in some way
but actual errors imply something crashed/the internal action did not complete the process of handling the request.
Regardless, the end goal is customizability, so if there is a way you'd like to see it done that doesn't match what you can get from it currently, we can make the necessary adjustments 🙂
That helps me understand the errors better. One type of error is like a 4xx error, and the other is like a 5xx error.
Yeah. It is still possible to get sort of "something unknown went wrong", but in such a way that the system handled it