Markus Podar
Markus Podar
- With the former you can return `User:where(…)->get()` (i.e. a collection) - with the latter only `User::where()->firstOrFail()` (i.e.. only a single model) Makes sense?
Btw, small technicality: 401 is "unauthorized", not unauthenticated.
Take a look at https://github.com/Folkloreatelier/laravel-graphql/blob/171631a17e4bf33780513f15221ea6052c67d498/src/Folklore/GraphQL/GraphQLController.php#L72-L77 If any error message matches `Unauthorized`, it's automatically turned into 403. You can extend the existing controller and use your own, see https://github.com/Folkloreatelier/laravel-graphql/blob/171631a17e4bf33780513f15221ea6052c67d498/src/config/config.php#L49 This way...
> but I think somehow it would be nicer to be able to extend the Error class and implement different types of errors with different status codes I also dislike...
You can use the fragment syntax to discriminate from _which_ of the union types you want to query the fields, e.g. see https://facebook.github.io/graphql/June2018/#sec-Unions : ```graphql union SearchResult = Photo |...
This change doens't look right. prefix is working fine for me. Can you elaborate more what your problem is and what it does fix?
OP misses the actual GraphQL query. Also it's 9 month old, the last linked repo doesn't exist either. @Lloydinator if you've a specific issue, please post specific information: - your...
@drmax24 I believe you need to make sure the `\Folklore\GraphQL\Support\Traits\ShouldValidate` is included in your type. It's by default for `\Folklore\GraphQL\Support\Mutation` and covers per-field rules as you describe it; but it's...
Update: > also: the existing authorize method does not contain the (user) $context This is actually wrong. Indeed, the signature in `\Folklore\GraphQL\Support\Field::authorize` is only: ```php public function authorize($root, $args) ```...
> I solved this the following way: >… > I simply did "cache" values on properties of the type I needed access to between authorize/resolve as not to query the...