close
The Wayback Machine - https://web.archive.org/web/20201005221257/https://github.com/gatsbyjs/gatsby/issues/26213
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

printTypeDefinitions does not generate schema.gql when not passing an empty object #26213

Open
juan871003 opened this issue Aug 4, 2020 · 4 comments · May be fixed by #27211
Open

printTypeDefinitions does not generate schema.gql when not passing an empty object #26213

juan871003 opened this issue Aug 4, 2020 · 4 comments · May be fixed by #27211

Comments

@juan871003
Copy link

@juan871003 juan871003 commented Aug 4, 2020

Summary

According to the documentation in https://www.gatsbyjs.org/docs/actions/#printTypeDefinitions all parameters are optional.

I tried using actions.printTypeDefinitions(); but it didn't generate the schema.gql file it should generate.
After some research I found out that I should pass an empty object like this: actions.printTypeDefinitions({});

I recommend stating this in the documentation, perhaps with an example:

export const createSchemaCustomization = async ({ actions }) => {
    ...
    //  generates a file ./schema.gql
    actions.printTypeDefinitions({});
    ...
    actions.createTypes(...);
}

Some recommended topics to cover:

Motivation

Adding sample code makes documentation much clearer.

@github-actions
Copy link

@github-actions github-actions bot commented Aug 24, 2020

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 💪💜

@meganesu
Copy link
Collaborator

@meganesu meganesu commented Sep 29, 2020

Hi there @juan871003! Thanks for bringing this up. I agree that adding an example would help make these docs clearer.

I'm adding the Hacktoberfest label to this issue so that hopefully a contributor from our community can pick this up.

Steps to resolve this issue

  • Add an example to the docs for printTypeDefinitions, to show that the first object parameter is required (even though all the fields in the object are optional).

Open a pull request

  • Open a pull request with your work including the words "closes #26213" in the pull request description
@Kolkies
Copy link

@Kolkies Kolkies commented Sep 29, 2020

Can I take this @meganesu?

@meganesu
Copy link
Collaborator

@meganesu meganesu commented Sep 29, 2020

@Kolkies of course, go for it! Feel free to reach out if you have any questions.

@Kolkies Kolkies linked a pull request that will close this issue Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants
You can’t perform that action at this time.