-
Notifications
You must be signed in to change notification settings - Fork 56
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
add directives definitions to import? #201
Comments
Currently what I've done: I've copied scripts to project and changed main func like this: export function importSchema(
schema: string,
schemas?: { [key: string]: string },
...typeDefs: string[] // added this
): string {
const sdl = [read(schema, schemas) || schema, ...typeDefs].join(' '); // changed this And it works like a charm ( |
on which file did you wrote this code? Thanks |
Unless I'm missing something, I'm also struggling with the same. |
This seem to be related #153 as it's any directive that's not directly declared in the imported schema, but imported at a later stage. In my case I would like to use
Update: Works fine as long as the directive has a basic defenition in the schema, which seems logical: directive @constraint(
minLength: Int,
maxLength: Int,
…
} on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION Sorry for any confusion. |
Hi @atten ! Let us know if your issue still persists. |
I have an app that parses schemas and is processing them.
I want to use a directive in these schemas, but not to write there it's definition (alike Prisma directives in datamodel). But I can't run import these schemas:
graphql-import
only works if I supply path to schema, not the schema content, so I can't simply concat directive definition during import.So is there a way to overcome this? To add definitions during import? Or make it simply to ignore absence of relation
The text was updated successfully, but these errors were encountered: