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

Write function to customer design doc #130

Open
lufishggg opened this issue Sep 16, 2020 · 0 comments
Open

Write function to customer design doc #130

lufishggg opened this issue Sep 16, 2020 · 0 comments

Comments

@lufishggg
Copy link

Have you ever consider write some methods to customer design doc? For example, there is a query doc:

doc, _ := gqlparser.LoadQuery(parsedSchema, "mutation($text: String!, $userId: String!) {createTodo(input: {text: $text, userId: $userId}) {id}}")

we can customer design and change the doc ( remove or and some selection, remove or add some arguments), something like:

addArguments(doc, "key"), then the doc will be:

var buf bytes.Buffer
formatter.NewFormatter(&buf).FormatQueryDocument(doc)
fmt.Println(buf.String())

output:
mutation($text: String!, $userId: String!, $key: String!) {createTodo(input: {text: $text, userId: $userId, key: $key}) {id}}"

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