# GraphQL Proof of concept ##### Main endpoint `POST http://127.0.0.1:5000/graphql` ##### Branch `graphql-proof-of-concept` ## Graphql API (self)documentation - browsing stuff ### Option #1 - GraphDoc http://127.0.0.1:5000/graphdoc/query.doc.html  #### For now schema has to be generated first rake graphdoc:dump_schema rake graphdoc:generate that will generate schema file in JSON format to hjemmelegene/tmp/graphql/schema.json ### Option #2 - GraphiQL http://127.0.0.1:5000/graphiql  ## Client apps for playing around with GraphQL queries ### Altair > :cherries: My new favorite for GraphQL! > [name=Jan][color=green] https://altair.sirmuel.design/  ### Postman https://www.postman.com/downloads/  ### Insomnia https://insomnia.rest/download ## Task list - [x] groundwork - [x] Documentation UI ### Queries: - [x] user - [ ] availableHours - [x] bookings - [x] serviceProviders - [x] currentUser ### Mutations: - [x] new OTP Session - [x] sign in User with OTP ## Example queries and mutations ```graphql= mutation { newOtpSession(phoneNumber: "+4791222121") { otpCode } } ``` ```graphql= mutation { signInUserOtp(phoneNumber: "+4791222121", code: "4444") { id firstName lastName } } ``` ```graphql= { currentUser { id firstName } } ``` ```graphql= query { serviceProviders(first: 5) { edges { node { id firstName lastName email phoneNumber address bio lat lng avatarUrl maxDistanceKm city zip adminNotes createdAt updatedAt } } } } ``` ```graphql= query { bookings(first: 5) { edges { cursor node { __typename id state beginsAt endsAt stripeChargeId userId serviceProviderId serviceProvider { id firstName lastName email phoneNumber address bio lat lng avatarUrl maxDistanceKm city zip adminNotes createdAt updatedAt } location treatmentFor lat lng arrivedAt createdAt updatedAt completedAt commentFeedback rating city zip } } } } ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up