$ npm install -g firebase-tools
See more Firebase CLI reference.
Run command into functions directory:
$ cd functions
$ npm install
$ cd functions
$ npm run serve
Firebase console
Playground http://localhost:5000/coffee-7be5e/us-central1/graphql
mutation CreateAccount {
createAccount(
input: {
phone: "+79009990001"
}
) {
id
phone
createAt
}
}
{
# id or phone or accountId from context
account(id: "xxQ1nOe0XSrw6YbsgKDq", phone: "+79040000088") {
id
phone
createAt
lastPaidOrders {
id
createAt
isFree
}
}
}
# accountId or accountId from context
mutation CreateOrder {
createOrder(
input: {
accountId: "bcWiTD34hAZKySWLVh9Z",
}
) {
id
createAt
isFree
}
}
{
orders(
pagination: {
limit: 12,
offset: 0
}
) {
pagination {
limit
offset
total
hasNext
}
items {
... on Order {
id
createAt
num
isFree
}
}
}
}
mutation Login {
login(
input: {
phone: "+79009990001"
}
) {
id
phone
createAt
lastPaidOrders {
id
createAt
isFree
}
}
}
# accountId or accountId from context
mutation UpdatePhone {
updatePhone(
input: {
accountId: "xxQ1nOe0XSrw6YbsgKDq",
newPhone: "+79040000000"
}
)
}