mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 17:31:56 +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
33 lines
784 B
YAML
33 lines
784 B
YAML
description: Tries to create an endpoint with trailing slash
|
|
url: /v1/query
|
|
status: 400
|
|
response:
|
|
internal:
|
|
- definition:
|
|
definition:
|
|
query:
|
|
collection_name: test_collection
|
|
query_name: simple_query
|
|
url: foo/
|
|
methods:
|
|
- GET
|
|
name: trailing
|
|
comment:
|
|
reason: "Empty segments or unnamed variables are not allowed: foo/"
|
|
name: endpoint trailing
|
|
type: endpoint
|
|
path: $.args
|
|
error: 'Empty segments or unnamed variables are not allowed: foo/'
|
|
code: invalid-configuration
|
|
query:
|
|
type: create_rest_endpoint
|
|
args:
|
|
url: "foo/"
|
|
name: trailing
|
|
methods:
|
|
- GET
|
|
definition:
|
|
query:
|
|
collection_name: test_collection
|
|
query_name: simple_query
|