Skip to content
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

Register a schema from a third-party plugin that is only used when specific conditions are met #707

Open
SCWells72 opened this issue Mar 15, 2024 · 0 comments

Comments

@SCWells72
Copy link

I'm logging this as a question as I'm not seeing an obvious answer in the docs, but in the spirit of honesty, I also haven't completely reviewed all of the docs, so the answer may well be there. Apologies if that's the case, and if so, please feel free to redirect me to the relevant section(s).

I have an existing third-party plugin that supports a framework that uses a specific GraphQL schema from JavaScript files in a specific, known context. I can easily recognize that context via the PSI tree, but I'm not sure how to programmatically tell the GraphQL to use a specific schema in that situation. I also can't quite figure out how to register a schema with the GraphQL plugin programmatically from another plugin. Are there well-defined EPs published by the GraphQL plugin for these two tasks, specifically 1) registering a schema; 2) using that schema when a specific PSI state is found? And to be clear, the GraphQL plugin is already recognizing the JavaScript string literal element as being a query, so I imagine it's more directing it to use the correct schema at that point based on the specific way it's being used (which, again, is a well-known contextual pattern).

Again, apologies if I'm wasting your time, but I figured it wouldn't hurt to ask for some guidance even if the end result is direction to specific documentation topics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant