export declare const content = "# GraphQL Integrations\n\nReference documentation for working with GraphQL APIs in Superblocks.\n\n## GraphQL Class\n\n```typescript\nimport { GraphQL } from \"@superblocksteam/library\";\n\nnew GraphQL(\"fetch_users\", \"graphql-integration-id\", {\n  query: `\n    query GetUsers($limit: Int!) {\n      users(limit: $limit) {\n        id\n        name\n        email\n      }\n    }\n  `,\n  variables: { limit: 10 },\n});\n```\n\n## Output Structure\n\n**IMPORTANT**: GraphQL responses have a specific structure:\n\n```typescript\n// GraphQL output format\n{\n  data: {\n    users: [...]\n  },\n  errors?: [...]\n}\n\n// Access query results\nnew JavaScript(\"process\", {\n  fn: ({ fetch_users }) => {\n    const result = fetch_users.output;\n    // Always access via .data property\n    return result.data.users;\n  }\n})\n```\n\n## Dynamic Queries\n\n```typescript\nnew GraphQL(\"search\", \"graphql-id\", {\n  query: `\n    query SearchUsers($term: String!, $limit: Int) {\n      searchUsers(term: $term, limit: $limit) {\n        id\n        name\n        matchScore\n      }\n    }\n  `,\n  variables: ({\n    searchTerm,\n    pageSize,\n  }: {\n    searchTerm: string;\n    pageSize: number;\n  }) => ({\n    term: searchTerm,\n    limit: pageSize,\n  }),\n});\n```\n\n## Mutations\n\n```typescript\nnew GraphQL(\"create_user\", \"graphql-id\", {\n  query: `\n    mutation CreateUser($input: CreateUserInput!) {\n      createUser(input: $input) {\n        id\n        name\n        email\n        createdAt\n      }\n    }\n  `,\n  variables: ({ name, email }: { name: string; email: string }) => ({\n    input: { name, email },\n  }),\n});\n```\n\n## Common Patterns\n\n### Query with Fragments\n\n```typescript\nnew GraphQL(\"complex_query\", \"graphql-id\", {\n  query: `\n    fragment UserFields on User {\n      id\n      name\n      email\n    }\n    \n    query GetUsersAndOrders($userId: ID!) {\n      user(id: $userId) {\n        ...UserFields\n        orders {\n          id\n          total\n          status\n        }\n      }\n    }\n  `,\n  variables: ({ userId }: { userId: string }) => ({ userId }),\n});\n```\n\n### Pagination with Connections\n\n```typescript\nnew GraphQL(\"paginated_list\", \"graphql-id\", {\n  query: `\n    query ListItems($first: Int!, $after: String) {\n      items(first: $first, after: $after) {\n        edges {\n          node {\n            id\n            name\n          }\n          cursor\n        }\n        pageInfo {\n          hasNextPage\n          endCursor\n        }\n      }\n    }\n  `,\n  variables: ({ pageSize, cursor }: { pageSize: number; cursor?: string }) => ({\n    first: pageSize,\n    after: cursor,\n  }),\n});\n```\n\n### Batch Operations\n\n```typescript\nnew GraphQL(\"batch_update\", \"graphql-id\", {\n  query: `\n    mutation BatchUpdateItems($updates: [ItemUpdateInput!]!) {\n      batchUpdateItems(updates: $updates) {\n        success\n        updatedCount\n        errors {\n          itemId\n          message\n        }\n      }\n    }\n  `,\n  variables: ({ items }: { items: Array<{ id: string; status: string }> }) => ({\n    updates: items.map((item) => ({\n      id: item.id,\n      status: item.status,\n    })),\n  }),\n});\n```\n\n## Error Handling\n\nGraphQL can return both data and errors:\n\n```typescript\nnew GraphQL(\"risky_query\", \"graphql-id\", { ... }),\n\nnew JavaScript(\"handle_response\", {\n  fn: ({ risky_query }) => {\n    const result = risky_query.output;\n\n    if (result.errors && result.errors.length > 0) {\n      // Handle partial errors\n      console.error(\"GraphQL errors:\", result.errors);\n    }\n\n    // Data may still be present even with errors\n    return result.data?.items ?? [];\n  }\n})\n```\n\n## Subscriptions\n\n**Note**: GraphQL subscriptions are not directly supported. For real-time data, consider:\n\n1. Polling with Loop blocks\n2. WebSocket integrations if available\n3. REST webhook endpoints\n\n## Best Practices\n\n1. **Always select specific fields** - Don't over-fetch\n2. **Use variables** - Never interpolate strings in queries\n3. **Handle partial responses** - GraphQL can return data with errors\n4. **Access via .data** - Always use `output.data.fieldName`\n5. **Use fragments** - For reusable field selections\n";
//# sourceMappingURL=graphql.generated.d.ts.map