Back to APIs list
Github API examples & templates
Use these vals as a playground to view and fork Github API examples and templates on Val Town. Run any example below or find templates that can be used as a pre-built solution.
graphQLYoga
@dthyresson
HTTP
GraphQL Yoga Server GraphQL Yoga from The Guild is a batteries-included cross-platform GraphQL over HTTP spec-compliant GraphQL server
powered by Envelop
and GraphQL Tools focused on easy setup, performance and great developer experience. Usage To access GraphiQL - the GraphQL Playground - visit the / route.
That's what you see in the preview pane below. Configuration and Documentation See the GraphQL Yoga documentation for configuration and all the bells and whistles. Endpoint For this example, we'll set to / to make it easier to demo. However, by default, the GraphQL route is configured to be on /graphql which is more common. const yoga = createYoga({
schema,
}) You can set a custom endpoint: const yoga = createYoga({
schema,
graphqlEndpoint: "/my-gql",
}) Landing Page A landing page is shown be default whenever a 404 is hit. You can disable it via the landingPage option. const yoga = createYoga({
schema,
landingPage: false
})
bbrun
@dglazkov
Script
A simple chat app harness for your board Provides a very simple chat app UI for a Breadboard board. For now, requires you to be running a board server. This harness actually acts
as a proxy to the board server run API endpoint ,
and puts a nice (well, somewhat nice) frontend on top of it. The frontend is somewhat limited in what it can show, currently supporting only
LLMContent and array of LLMContent outputs, and only LLMContent array input. The script will look for the BB_LIVE_KEY in your Val Town environment, which
must contain your board server API key. To use, create an HTTP val, then import the proxy function from this script and call it like this:
import { proxy } from "https://esm.town/v/dglazkov/bbrun";
export default proxy(
"url-to-the-board.bgl.json",
);