graphql-nexus / nexus

Code-First, Type-Safe, GraphQL Schema Construction
https://nexusjs.org
MIT License
3.4k stars 275 forks source link

Docs: adding examples or documenting interfaces #138

Open mattcan opened 5 years ago

mattcan commented 5 years ago

I was looking through the documentation (specifically for makeSchema) and realised that the interface types are not documented. I don't have an issue reading through source code but being able to link to interface documentation and/or example code would be beneficial in my opinion.

One example requires hunting down the type definition in source code:

  /**
   * Configures the default "nonNullDefaults" for the entire schema the type.
   * Read more about how nexus handles nullability
   */
  nonNullDefaults?: NonNullConfig;

I am happy to kickstart some of this work but want to make sure it would be useful to others and get direction from the maintainers. Is there a style guide I can use or should I base it on existing docs? Any upcoming plans to change the documentation I should be aware of?

Thank you!

tgriesser commented 5 years ago

Yep, this is a glaring gap in Nexus documentation... which is bad because a properly configured schema/types is like 90% of what gives Nexus its power. Any help would be appreciated!

Is there a style guide I can use or should I base it on existing docs?

Not in particular, just write it as it would make sense to you based on your usage

Any upcoming plans to change the documentation I should be aware of?

Nope, just hopefully going to get around to adding more of them 😄

mattcan commented 5 years ago

Thanks for the info! I've been taking a look at auto generating the docs and I have found some tools to do it.

Ran a quick experiment and it seems to work but I'll work out a way so that the workflow is smooth.

Here is the branch I am working from: https://github.com/mattcan/nexus/tree/interface-docs