GraphQL client integration for mobile applications
Integrates GraphQL clients for mobile apps with Apollo configuration and code generation.
npx claudepluginhub a5c-ai/babysitterThis skill inherits all available tools. When active, it can use any tool Claude has access to.
README.mdThis skill provides GraphQL client integration capabilities for mobile applications. It enables configuration of Apollo Client, code generation, caching strategies, and real-time subscriptions.
bash - Execute codegen and build toolsread - Analyze GraphQL schemas and querieswrite - Generate typed operations and configurationsedit - Update GraphQL implementationsglob - Search for GraphQL filesgrep - Search for patternsClient Configuration
Caching
Apollo iOS
Apollo Android
graphql-apollo-integration.js - GraphQL implementationoffline-first-architecture.js - Offline cachingmobile-performance-optimization.js - Query optimization// apollo/client.ts
import { ApolloClient, InMemoryCache, createHttpLink, split } from '@apollo/client';
import { GraphQLWsLink } from '@apollo/client/link/subscriptions';
import { getMainDefinition } from '@apollo/client/utilities';
import { setContext } from '@apollo/client/link/context';
import { createClient } from 'graphql-ws';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { AsyncStorageWrapper, CachePersistor } from 'apollo3-cache-persist';
const httpLink = createHttpLink({
uri: 'https://api.example.com/graphql',
});
const wsLink = new GraphQLWsLink(
createClient({
url: 'wss://api.example.com/graphql',
connectionParams: async () => {
const token = await AsyncStorage.getItem('authToken');
return { authorization: token ? `Bearer ${token}` : '' };
},
})
);
const authLink = setContext(async (_, { headers }) => {
const token = await AsyncStorage.getItem('authToken');
return {
headers: {
...headers,
authorization: token ? `Bearer ${token}` : '',
},
};
});
const splitLink = split(
({ query }) => {
const definition = getMainDefinition(query);
return definition.kind === 'OperationDefinition' && definition.operation === 'subscription';
},
wsLink,
authLink.concat(httpLink)
);
const cache = new InMemoryCache({
typePolicies: {
Query: {
fields: {
posts: {
keyArgs: false,
merge(existing = [], incoming) {
return [...existing, ...incoming];
},
},
},
},
},
});
export const persistor = new CachePersistor({
cache,
storage: new AsyncStorageWrapper(AsyncStorage),
});
export const client = new ApolloClient({
link: splitLink,
cache,
defaultOptions: {
watchQuery: {
fetchPolicy: 'cache-and-network',
},
},
});
# codegen.yml
schema: https://api.example.com/graphql
documents: 'src/**/*.graphql'
generates:
src/generated/graphql.ts:
plugins:
- typescript
- typescript-operations
- typescript-react-apollo
config:
withHooks: true
withComponent: false
withHOC: false
skipTypename: false
dedupeFragments: true
// features/posts/hooks/usePosts.ts
import { usePostsQuery, useCreatePostMutation } from '../../../generated/graphql';
export function usePosts() {
const { data, loading, error, refetch, fetchMore } = usePostsQuery({
variables: { first: 10 },
notifyOnNetworkStatusChange: true,
});
const [createPost] = useCreatePostMutation({
update(cache, { data }) {
cache.modify({
fields: {
posts(existingPosts = []) {
const newPostRef = cache.writeFragment({
data: data?.createPost,
fragment: PostFragmentDoc,
});
return [newPostRef, ...existingPosts];
},
},
});
},
optimisticResponse: (variables) => ({
__typename: 'Mutation',
createPost: {
__typename: 'Post',
id: 'temp-id',
title: variables.title,
body: variables.body,
createdAt: new Date().toISOString(),
},
}),
});
const loadMore = () => {
if (data?.posts.pageInfo.hasNextPage) {
fetchMore({
variables: {
after: data.posts.pageInfo.endCursor,
},
});
}
};
return {
posts: data?.posts.edges.map((e) => e.node) ?? [],
loading,
error,
refetch,
loadMore,
createPost,
};
}
// Apollo/Network.swift
import Apollo
import ApolloWebSocket
class Network {
static let shared = Network()
private(set) lazy var apollo: ApolloClient = {
let store = ApolloStore(cache: InMemoryNormalizedCache())
let provider = DefaultInterceptorProvider(store: store)
let url = URL(string: "https://api.example.com/graphql")!
let transport = RequestChainNetworkTransport(
interceptorProvider: provider,
endpointURL: url
)
return ApolloClient(networkTransport: transport, store: store)
}()
}
rest-api-integration - REST integrationoffline-storage - Offline cachingfirebase-mobile - Firebase alternativeActivates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use for discovering, retrieving, and improving prompts.
Search, retrieve, and install Agent Skills from the prompts.chat registry using MCP tools. Use when the user asks to find skills, browse skill catalogs, install a skill for Claude, or extend Claude's capabilities with reusable AI agent components.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.