-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Initial GraphQL docs #12
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
Conversation
| } | ||
| } | ||
| } | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be worthwhile to add an example that shows and, or and not filters, just after this query.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah these are very common asks. Let's actually put that in the text too so that it gets indexed in search engines too.
| are investigating using adjacency lists along side GSIs for different use cases that are | ||
| connection heavy. | ||
|
|
||
| TODO: Finish docs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this be followed up in a different CR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I'll either update it or remove the TODO depending on when we want to get this merged.
snvishna
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments but LGTM.
mwudtke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, looks good to me. Most of what I offered were my opinions on wording and grammar, along with some typos.
js/graphql.md
Outdated
|
|
||
| The GraphQL Transform is a library that simplifies the process of developing, deploying, and maintaining GraphQL APIs. With it, you define your API using the GraphQL Schema Definition Language (SDL) and can then use this library where to transform it into a fully descriptive cloudformation template that implements the API's data model. | ||
|
|
||
| The Transform can be run as an independent library, however it is integrated into the Amplify CLI via the `API` category for you to use immediately. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"The Transform can be run as an independent library, and it is also integrated into the Amplify CLI via the API category for you to use immediately."
More opinions
| @@ -0,0 +1,1374 @@ | |||
| --- | |||
| --- | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a TOC at the top so that people can quick link direct to the specific directive they want to read about?
js/graphql.md
Outdated
| # The GraphQL Transform | ||
|
|
||
| The GraphQL Transform is a library that simplifies the process of designing GraphQL APIs. | ||
| In short, it allows a developer to design application backends with a simple `schema.graphql` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... schema.graphql file...
js/graphql.md
Outdated
|
|
||
| The GraphQL Transform is a library that simplifies the process of designing GraphQL APIs. | ||
| In short, it allows a developer to design application backends with a simple `schema.graphql` | ||
| which is then *transformed* into a AWS CloudFormation that implements the data model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... AWS CloudFormation document...
js/graphql.md
Outdated
| The GraphQL Transform is a library that simplifies the process of designing GraphQL APIs. | ||
| In short, it allows a developer to design application backends with a simple `schema.graphql` | ||
| which is then *transformed* into a AWS CloudFormation that implements the data model | ||
| defined in `schema.graphql`. For example you might create the backend for a blog like this: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...defined in a schema.graphql file with annotations such as @model or @connection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mikeparisstuff I've been calling these "annotations" recently as it's friendly nomenclature for developers unfamiliar with GraphQL, but happy to call these "directives" if you think that's better.
| #### Definition | ||
|
|
||
| ``` | ||
| directive @model( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might be worthwhile calling this "API Definition" and then explaining with a one-liner "XXX below defines the @model capabilities, allowing you to YYYY...."
Reason I say this is some people have confused this in the older docs with what they blindly copied & pasted into their SDL, which is actually in the "Usage" section below.
| must also be annotated with `@model`. Currently, Amazon Cognito user pools | ||
| is the only supported authorization mode. | ||
|
|
||
| #### Definition |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar feedback to API definition above.
js/graphql.md
Outdated
|
|
||
| #### Usage | ||
|
|
||
| Annotate a `@model` type with the `@versioned` directive to add object versioning and conflict detection to a type. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...This can be used as part of your GraphQL API or in conjunction with the AppSync client SDKs for Android, iOS, or JavaScript. For an example please see this REFERENCE.
|
|
||
| Here is a complete list of searchable operations per GraphQL type supported as of today: | ||
|
|
||
| | GraphQL Type | Searchable Operation | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fracking love this table.
| } | ||
| ``` | ||
|
|
||
| ### Task App |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a little prose here "The following is a tutorial of using the transformer to build a backend for a task management application that supports...."
undefobj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added inline comments, some are minor but the points about future features need to be addressed before release please.
|
@mikeparisstuff I also just remembered where is the S3 stuff now that we support it? |
|
Sorry fat fingered |
341d067 to
ea11937
Compare
|
@mikeparisstuff this looks good to me. I think there are still some clarifications we can do around the amplify CLI flow in a couple of places and also the S3Object stuff from our conversation earlier today around usage with the helpers, but this is a good doc update that we should get in the hands of customers. I also looked at the building a custom transformer section deeper and it talks about structure but we might want to expand on this in the future with specifics on the business logic. Let's chat more this is good for publishing. |
eefce35 to
0b7587e
Compare
|
What's the status on merging these? I just added more details on advanced auth use cases that I just put in PR in the other repo. |
``` E/flutter (30435): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: type '_InternalLinkedHashMap<String, dynamic>' is not a subtype of type 'Map<String, String>' E/flutter (30435): #0 new CognitoSignUpOptions (package:amplify_auth_cognito/src/CognitoSignUp/CognitoSignUpOptions.dart:20:87) E/flutter (30435): #1 SignUpState._signUp (package:AwsAmplifySample/components/signUp.dart:29:20) E/flutter (30435): #2 SignUpState.build.<anonymous closure> (package:AwsAmplifySample/components/signUp.dart:190:35) E/flutter (30435): #3 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:993:19) E/flutter (30435): #4 _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:1111:38) E/flutter (30435): #5 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:183:24) E/flutter (30435): #6 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:598:11) E/flutter (30435): #7 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:287:5) E/flutter (30435): #8 BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:259:7) E/flutter (30435): #9 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:157:27) E/flutter (30435): #10 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:362:20) E/flutter (30435): #11 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:338:22) E/flutter (30435): #12 RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:267:11) E/flutter (30435): #13 GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:295:7) E/flutter (30435): #14 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:240:7) E/flutter (30435): #15 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:213:7) E/flutter (30435): #16 _rootRunUnary (dart:async/zone.dart:1206:13) E/flutter (30435): #17 _CustomZone.runUnary (dart:async/zone.dart:1100:19) E/flutter (30435): #18 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1005:7) E/flutter (30435): #19 _invoke1 (dart:ui/hooks.dart:265:10) E/flutter (30435): #20 _dispatchPointerDataPacket (dart:ui/hooks.dart:174:5) E/flutter (30435): ``` If `dynamic` is used
This adds a bunch of GraphQL documentation and a new section to the amplify docs to contain it.