mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-16 09:51:59 +03:00
83045a4459
During the "generalization" of the code, we removed the [generated instances](9d63187803 (diff-7b8382ab20e441fa214586be491eb6f7ca904d8b20ed97894c16a339be45219aL72)
) of `Eq` and `Hashable` in favour of manually written ones, because for a time we were struggling with `AnyBackend`.
In the process, we lost one constructor, `MOEndpoint`. It's unlikely to have ever been an issue, since duplicate endpoints are unlikely, but it is nonetheless wrong.
This PR simply goes back to default derived instances, now that we can, fixing the problem and making the code simpler.
---
However, after filing this PR, I realized **it broke rest endpoint tests**. Upon closer inspection, it turns out that while we had proper checks in place, because of this bug we were actually failing _differently_ during metadata checks. This PR actually improves error messages for invalid endpoint configurations?! 🙀
This is a tiny bit scary. ^^'
https://github.com/hasura/graphql-engine-mono/pull/1762
GitOrigin-RevId: c4897d1f3ae92d18c44c87d2f58258c66f716686
36 lines
894 B
YAML
36 lines
894 B
YAML
description: Try to add an endpoint with duplicate params
|
|
url: /v1/query
|
|
status: 400
|
|
response:
|
|
internal:
|
|
- definition:
|
|
definition:
|
|
query:
|
|
collection_name: test_collection
|
|
query_name: simple_subscription
|
|
url: foo/bar/subscribe
|
|
methods:
|
|
- GET
|
|
name: foo
|
|
comment:
|
|
reason:
|
|
"Inconsistent object: in endpoint foo: query with name simple_subscription
|
|
is a subscription"
|
|
name: endpoint foo
|
|
type: endpoint
|
|
path: $.args
|
|
error: 'Inconsistent object: in endpoint foo: query with name simple_subscription
|
|
is a subscription'
|
|
code: invalid-configuration
|
|
query:
|
|
type: create_rest_endpoint
|
|
args:
|
|
url: "foo/bar/subscribe"
|
|
name: foo
|
|
methods:
|
|
- GET
|
|
definition:
|
|
query:
|
|
collection_name: test_collection
|
|
query_name: simple_subscription
|