Replies: 1 comment 2 replies
-
Great question! Many adapters do in fact define an inherent method for getting a schema, exactly as you suggest. For example: https://github.com/obi1kenobi/trustfall-rustdoc-adapter/blob/rustdoc-v24/src/adapter/mod.rs#L44 The method isn't part of the trait itself because there wasn't a clear and obvious advantage to requiring it, and there was a downside of "it isn't clear whether the method should return Also, in principle, one might want to be able to get the schema without making (or even knowing about) the adapter. For example, if a user is writing a query in their browser, having a schema (but not an adapter!) in the browser means you can type-check their query, offer autocompletions, etc. The adapter is simply not necessary here, and requiring |
Beta Was this translation helpful? Give feedback.
-
I am wondering why the schema is not integrated into the Adapter trait but why it is decoupled instead. It seems to me like the adapter can only query the things specified in the schema anyway.
What implications would occur when integrating the Schema definition into the Adapter trait by e.g. a new Adapter::schema method?
Beta Was this translation helpful? Give feedback.
All reactions