Anyone thought of connecting Hasura to Discourse's Postgres database for a potentially more customised (or narrowed down) FE?

Ok can’t wait!. I tried with graphql-mesh.
So, the openapi file under the download button in https://docs.discourse.org/ seems broken :confused:
I tested validity here with this output:

Swagger schema validation failed. 
  Data does not match any schemas from 'oneOf' at #/paths//page_view_total_reqs/get/parameters/3
    Data does not match any schemas from 'oneOf' at #/paths//page_view_total_reqs/get/parameters/3
      Missing required property: schema at #/
      Missing required property: content at #/
    Missing required property: $ref at #/paths//page_view_total_reqs/get/parameters/3
  Data does not match any schemas from 'oneOf' at #/paths//page_view_total_reqs/get/parameters/2
    Data does not match any schemas from 'oneOf' at #/paths//page_view_total_reqs/get/parameters/2
      Missing required property: schema at #/
      Missing required property: content at #/
    Missing required property: $ref at #/paths//page_view_total_reqs/get/parameters/2
  Data does not match any schemas from 'oneOf' at #/paths//page_view_total_reqs/get/parameters/1
    Data does not match any schemas from 'oneOf' at #/paths//page_view_total_reqs/get/parameters/1
      Missing required property: schema at #/
      Missing required property: content at #/
    Missing required property: $ref at #/paths//page_view_total_reqs/get/parameters/1
  Data does not match any schemas from 'oneOf' at #/paths//page_view_total_reqs/get/parameters/0
    Data does not match any schemas from 'oneOf' at #/paths//page_view_total_reqs/get/parameters/0
      Missing required property: schema at #/
      Missing required property: content at #/
    Missing required property: $ref at #/paths//page_view_total_reqs/get/parameters/0
 
JSON_OBJECT_VALIDATION_FAILED

Error: Swagger schema validation failed. 
  Data does not match any schemas from 'oneOf' at #/paths//page_view_total_reqs/get/parameters/3
    Data does not match any schemas from 'oneOf' at #/paths//page_view_total_reqs/get/parameters/3
      Missing required property: schema at #/
      Missing required property: content at #/
    Missing required property: $ref at #/paths//page_view_total_reqs/get/parameters/3
  Data does not match any schemas from 'oneOf' at #/paths//page_view_total_reqs/get/parameters/2
    Data does not match any schemas from 'oneOf' at #/paths//page_view_total_reqs/get/parameters/2
      Missing required property: schema at #/
      Missing required property: content at #/
    Missing required property: $ref at #/paths//page_view_total_reqs/get/parameters/2
  Data does not match any schemas from 'oneOf' at #/paths//page_view_total_reqs/get/parameters/1
    Data does not match any schemas from 'oneOf' at #/paths//page_view_total_reqs/get/parameters/1
      Missing required property: schema at #/
      Missing required property: content at #/
    Missing required property: $ref at #/paths//page_view_total_reqs/get/parameters/1
  Data does not match any schemas from 'oneOf' at #/paths//page_view_total_reqs/get/parameters/0
    Data does not match any schemas from 'oneOf' at #/paths//page_view_total_reqs/get/parameters/0
      Missing required property: schema at #/
      Missing required property: content at #/
    Missing required property: $ref at #/paths//page_view_total_reqs/get/parameters/0
 
JSON_OBJECT_VALIDATION_FAILED
    at o (https://apitools.dev/swagger-parser/online/js/bundle.min.js:1:73766)
    at https://apitools.dev/swagger-parser/online/js/bundle.min.js:17:227596

SyntaxError: Swagger schema validation failed. 
  Data does not match any schemas from 'oneOf' at #/paths//page_view_total_reqs/get/parameters/3
    Data does not match any schemas from 'oneOf' at #/paths//page_view_total_reqs/get/parameters/3
      Missing required property: schema at #/
      Missing required property: content at #/
    Missing required property: $ref at #/paths//page_view_total_reqs/get/parameters/3
  Data does not match any schemas from 'oneOf' at #/paths//page_view_total_reqs/get/parameters/2
    Data does not match any schemas from 'oneOf' at #/paths//page_view_total_reqs/get/parameters/2
      Missing required property: schema at #/
      Missing required property: content at #/
    Missing required property: $ref at #/paths//page_view_total_reqs/get/parameters/2
  Data does not match any schemas from 'oneOf' at #/paths//page_view_total_reqs/get/parameters/1
    Data does not match any schemas from 'oneOf' at #/paths//page_view_total_reqs/get/parameters/1
      Missing required property: schema at #/
      Missing required property: content at #/
    Missing required property: $ref at #/paths//page_view_total_reqs/get/parameters/1
  Data does not match any schemas from 'oneOf' at #/paths//page_view_total_reqs/get/parameters/0
    Data does not match any schemas from 'oneOf' at #/paths//page_view_total_reqs/get/parameters/0
      Missing required property: schema at #/
      Missing required property: content at #/
    Missing required property: $ref at #/paths//page_view_total_reqs/get/parameters/0
 
JSON_OBJECT_VALIDATION_FAILED
    at Function.o [as syntax] (https://apitools.dev/swagger-parser/online/js/bundle.min.js:1:73766)
    at validateSchema (https://apitools.dev/swagger-parser/online/js/bundle.min.js:1:5021)
    at SwaggerParser.validate (https://apitools.dev/swagger-parser/online/js/bundle.min.js:1:3171)

z-schema validation error: JSON_OBJECT_VALIDATION_FAILED
    at ZSchema.getLastError (https://apitools.dev/swagger-parser/online/js/bundle.min.js:17:211187)
    at validateSchema (https://apitools.dev/swagger-parser/online/js/bundle.min.js:1:4925)
    at SwaggerParser.validate (https://apitools.dev/swagger-parser/online/js/bundle.min.js:1:3171)

So I searched for another openapi or swagger file of the discourse api. I just found this one.
It’s little broken line 426, but I fixed it.

After set graphql-mesh, I got a working graphql api! But…
This swagger file is not complete or too old. There is only 4 queries, no mutations, type user as few properties… :confused:

Is there somewhere a swagger or openapi file of discourse?

2 Likes