question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expose `inputParser` on `Procedure`?

See original GitHub issue

Hi - have just started using trpc and it is 👌

One request: what do you think about exposing the (zod) schema on the Procedure object? The use-case being, I would like to create a UI in an internal admin app using react-json-schema-form for various whitelisted “admin” queries/mutations. If we could access appRouter._def.queries.myQuery.inputParser we could pass it to zod-to-json-schema which would give us some schemas we could use with react-json-schema-form.

It’s possible to do now by suppressing the typescript error about using a private field, but I wanted to see if you’d be open to making it public so that it wouldn’t disappear and break our workflow in a minor update.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
KATTcommented, Jul 23, 2021

@mmkal - I’ll leave the PR + docs to you then. Would be really cool get an example of this up and running on retool, such a timesaver.

1reaction
KATTcommented, Jul 22, 2021

On phone, will give example tomorrow, but

  1. Define schema in React component
  2. Import said schema into your the trpc router
Read more comments on GitHub >

github_iconTop Results From Across the Web

Expose inputParser on Procedure ? #714 - trpc/trpc - GitHub
Hi - have just started using trpc and it is. One request: what do you think about exposing the (zod) schema on the...
Read more >
Input parser for functions - MATLAB - MathWorks
The inputParser object enables you to manage inputs to a function by creating an input parser scheme.
Read more >
Test procedure - Mini-EUSO software - Read the Docs
Before starting tests run mecontrol -help , this calls InputParser::PrintHelpMsg() function to see all available commands.
Read more >
Argparse Tutorial — Python 3.11.1 documentation
The parse_args() method actually returns some data from the options specified, in this case, echo . The variable is some form of 'magic'...
Read more >
python - What's the best way to parse command line arguments?
argparse is the way to go. Here is a short summary of how to use it: 1) Initialize import argparse # Instantiate the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found