Skip to content

Instantly share code, notes, and snippets.

View undefobj's full-sized avatar
😎

Richard Threlkeld undefobj

😎
View GitHub Profile
This is an example with a simple TODO schema:
```graphql
type Todo @model {
id: ID!
name: String!
description: String
}
```
@undefobj
undefobj / App.js
Created February 22, 2020 00:33
Repro
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow
*/
import React, { useEffect } from 'react';
import {
@undefobj
undefobj / index.js
Last active August 17, 2022 18:28
Calling AppSync from Lambda
const https = require('https');
const AWS = require("aws-sdk");
const urlParse = require("url").URL;
const appsyncUrl = process.env.API_BACKENDGRAPHQL_GRAPHQLAPIENDPOINTOUTPUT;
const region = process.env.REGION;
const endpoint = new urlParse(appsyncUrl).hostname.toString();
const graphqlQuery = require('./query.js').mutation;
const apiKey = process.env.API_KEY;
exports.handler = async (event) => {
//DynamoDB table with Primary Key "id" and each item has attributes "title" and "author
//If you have an item in the table that only has one of these attributes, the search will fail
//Use the below GraphQL schema:
type Post {
id: ID!
title: String!
author: String!
}