hyperweb-io / hyperweb-io/ts-codegen
No query helpers generated for string queries
- Lenguaje dominante
- TypeScript
- Estrellas
- 126
- Forks
- 31
- Merge medio
- 19 min
- PR fusionados (30 d)
- 2
Descripción
If we have a query like this:
```rust
#[returns(Config)]
GetConfig,
```
The client will not generate a query helper for it, rather just ignore it (unless i missed an option for it)
Tho it will recognize it as a type in the types file:
```ts
export type QueryMsg = "get_admin" | "get_config" ...
```
But that doesn't help much, as the general query of the `SigningCosmWasmClient` function doesn't know those types, so its not really giving me any type checks.
1. The preferred way for me:
To generate a simple helpers for those queries as well, will make it a lot easier to use.
2. Less preferred way
Generate a general query message specific to the schema, this at least will give us some type checks as the general query function will accept the contract specific `QueryMsg` and not just `any`.
Something like:
```ts
query = async (msg: QueryMsg): Promise => {
return this.client.queryContractSmart(this.contractAddress, msg);
};
```
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Empieza rastreando cómo las entradas #[returns(Config)] se convierten en tipos QueryMsg y helpers de consulta generados, y luego compara ese recorrido con la llamada queryContractSmart de SigningCosmWasmClient. Decide si las consultas string deberían recibir helpers o un método de consulta QueryMsg específico del esquema; se considera terminado cuando los clientes generados proporcionen acceso con comprobación de tipos a estas consultas.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- rust, typescript
- Área
- tooling
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100