Skip to content

Instantly share code, notes, and snippets.

View hackintoshrao's full-sized avatar
📚
Exploring AI agents on code search and understanding

Karthic Rao hackintoshrao

📚
Exploring AI agents on code search and understanding
View GitHub Profile
const GET_DOG_PHOTO = gql`
query Dog($breed: String!) {
dog(breed: $breed) {
id
displayImage
}
}
`;
<style>
.circle {
background-color: red;
border-radius: 999px;
height: 50px;
width: 50px;
}
</style>
<div class="circle"></div>
function Books({ onBookSelected }) {
const { loading, error, data } = useQuery(GET_BOOKS);
if (loading) return 'Loading...';
if (error) return `Error! ${error.message}`;
return (
<select name="book" onChange={onBookSelected}>
{data.books.map(book => (
<option key={book.id} value={book.title}>
import { gql, useQuery } from '@apollo/client';
const GET_BOOKS = gql`
query GetBooks {
books {
id
title
}
}
`;
<!-- Example1.astro - Static HTML is a valid Astro component! -->
<div class="example-1">
<h1>Hello world!</h1>
</div>
{
"errors":[
{
"message":"Cannot query field \"__typenam\" on type \"Query\".",
"locations":[
{
"line":1,
"column":2
}
],
# prerequisite: check that Node.js is 12.20.0+, 14.13.1+, or 16+
node --version
# Make a new project directory, and navigate directly into it
mkdir my-astro-project && cd $_
# prepare for liftoff...
npm init astro
# install dependencies
{
"errors": [
{
"message": "Name for character with ID 1002 could not be fetched.",
"locations": [ { "line": 6, "column": 7 } ],
"path": [ "hero", "heroFriends", 1, "name" ],
}
]
}
{
"errors": [
{
"extensions": {
"path": "$.variableValues",
"code": "validation-failed"
},
"message": "unexpected variables in variableValues: products"
}
]
{
"data": [{ id: 1, name: "Praveen"}],
"errors": []
}