-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there any way to use introspection in a Relay query fragment #162
Comments
There's no reason why this couldn't work. @dschafer I tried transpiling an instrospection query with
Probably because the |
Yeah, there was some discussion whether It's not clear to me that issuing an introspection query to the server at runtime would always be ideal; in particular, introspection queries might be relatively inefficient (I know this is true of Facebook's schema), and they might change underneath the client (for example, developers might add or deprecate fields on the record, so the client might get a field that it isn't familiar with). On the other hand, using an introspection query to quickly bootstrap a client-side view seems like it would be an awesome way to get off of the ground; it might be interesting to build a mutation scaffold that would use introspection to find all mutations, then build basic form views for executing those mutations. |
Thanks for asking about this, it's an interesting idea. We'll keep this in mind going forward, but we are not likely to add this soon. I'm going to close this out but feel free to reopen if you have more questions or if this is a blocker (in which case, the change would have to happen in |
The use case i have in mind is a form for creating a complex record. Ideally, I'd like to be able to use introspection to pull down a schema of the record and then use that to generate some form fields. I was wondering what you thought of this use case and/or if there is a simple way to do this in Relay. I suppose I could create a "default record" and then display that in my form, but I figured I would try being clever first.
The text was updated successfully, but these errors were encountered: