Comments (5)
Could have nice to have this in the doc, I've been looking for it as well ;)
from graphdoc.
Hello @mlapeyre3
Sorry for the delay.
To document a parameter with the IDL place the comment just before
You can see an example in the IDL of the mutation and its corresponding documentation
In your case it would remain like this:
# The root query object
type Query {
# Fetch an Order given its id.
order(
# Description of the id argument
id: ID
): Order
}
from graphdoc.
@2fd , I was playing around following you examples without success for my use case.
I'm using an API gateway which does the schema stitching with micro-services (all in graphql).
So I read a bit more on the difference between simple comments and description.
http://facebook.github.io/graphql/June2018/#sec-Descriptions
So I changed from:
# Base user type
type User {
# User unique id
id: ID!
# The full user name
name: String!
# The user email address
email: Email!
}
To:
"Base user type"
type User {
"Its unique id, which have to be an Int"
id: ID!
"The full user name"
name: String!
"The user email address"
email: Email!
}
And that works !
As @sp00m proposed, it would be really nice to have this documented.
I can do a PR if you want ...
from graphdoc.
Hi @2fd,
I am trying to describe arguments for a given query.
This scheme:
# The root query object
type Query {
# Fetch an Order given its id.
order(id: ID): Order
}
So now I try:
# The root query object
#
# Arguments
# id: Description of the id argument
type Query {
# Fetch an Order given its id.
order(id: ID): Order
}
but it does not work.
I may not be that familiar with the shorthand notation. How can I add a description to an argument?
Thanks a lot !
from graphdoc.
Hi @2fd,
Thanks, it works great!
I was typing the query order
as a single line ... :)
from graphdoc.
Related Issues (20)
- Comments and Nulls HOT 2
- What if my endpoint requires an oAuth token? HOT 3
- Attribute not documented HOT 2
- Expected Name, found String HOT 2
- Doesn't support comments in """ blocks HOT 4
- Syntax Error GraphQL (740:50) Unexpected character "&". HOT 1
- Support piped input for generating documentation HOT 1
- Drop support for older node versions
- Last published to npm 3 years ago
- Prettier config: Default config + run once on codebase
- Remove bluebird?
- Request more clear documentation for how to use headers when connecting to an endpoint.
- While creating doc, getting error Error: Invalid character Code: 800A03F6 Source: Microsoft JScript compilation error
- I get the following error: Type "AWSJSON" not found in document. HOT 3
- Arguments not showing for all queries and mutations
- Ability to filter out "Not documented"
- [Security] Workflow pull_request.yml is using vulnerable action actions/checkout
- [Security] Workflow release.yml is using vulnerable action actions/checkout
- [Feature Request] - link to the line number on a given docs page
- allow to explicitly specify schema extension
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphdoc.