#community-help

Live GraphQL Endpoint for TypeSense API Conversion

TLDR Paul is trying to convert TypeSense API to GraphQL and wants a live endpoint for a better schema. Jason suggests forking the openapi spec and adding their document structure.

Powered by Struct AI
Jun 13, 2023 (3 months ago)
Paul
Photo of md5-38acaeddf8807738f5b4d355349769fd
Paul
09:24 AM
Hi there! I’m trying to convert the TypeSense API to GraphQL with GraphQL Mesh and that seems to be going well. However the spec https://github.com/typesense/typesense-api-spec/blob/master/openapi.yml isn’t ‘live’, as in: It doesn’t describe the fields, etc. of the documents. Might it be possible to get a ‘live’ endpoint that also describes all possible schema’s?

The way it works, is that the GraphQL Mesh openapi handler will automatically convert any written openapi specification to a fully compatible GraphQL schema. If the Openapi schema is describing the current API sufficiently enough it will expose everything to GraphQL.

Is that something you guys might be interested in?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
10:32 AM
Hi Paul, can you please elaborate what you mean by "doesn't describe the fields"?
Paul
Photo of md5-38acaeddf8807738f5b4d355349769fd
Paul
11:19 AM
It would specifically be amazing if this could be more detailed: https://github.com/typesense/typesense-api-spec/blob/master/openapi.yml#L1440 So the type of actual possible documents are exposed.
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
02:50 PM
Documents are fully user-defined key-value pairs… since users can store any JSON objects in Typesense
Jun 14, 2023 (3 months ago)
Paul
Photo of md5-38acaeddf8807738f5b4d355349769fd
Paul
10:16 AM
Yeah I understand that but ‘user defined’ usually means ‘backend developer defined’, woud be nice if a ‘frontend developer’ could get the expected document structure, wouldn’t it?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:34 PM
I see… You’d essentially have to fork that openapi spec and add your documents’ structure to it
Jun 15, 2023 (3 months ago)
Paul
Photo of md5-38acaeddf8807738f5b4d355349769fd
Paul
10:40 AM
Yeah, that is the plan right now. But if it was exposed from a typesense instance it could do that automatically