Skip to content

Commit a49d15d

Browse files
committed
Drop Laravel 11 support
1 parent 246993e commit a49d15d

File tree

3 files changed

+85
-5
lines changed

3 files changed

+85
-5
lines changed

.github/workflows/run-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ jobs:
1818
matrix:
1919
os: [ubuntu-latest]
2020
php: [8.3]
21-
laravel: [11.*]
21+
laravel: [12.*]
2222
stability: [prefer-lowest, prefer-stable]
2323
include:
24-
- laravel: 11.*
25-
testbench: 9.*
24+
- laravel: 12.*
25+
testbench: 10.*
2626
carbon: ^3.0
2727

2828
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}

CLAUDE.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
Laravel package providing a GraphQL client for Shopify's Admin API, built on Saloon HTTP client.
8+
9+
## Commands
10+
11+
```bash
12+
composer test # Run tests (Pest)
13+
composer analyse # Run PHPStan (level 9)
14+
composer format # Run Laravel Pint
15+
```
16+
17+
Run a single test:
18+
```bash
19+
./vendor/bin/pest tests/ExampleTest.php
20+
./vendor/bin/pest --filter="test name"
21+
```
22+
23+
## Architecture
24+
25+
### Client Flow
26+
27+
1. `GraphQLClient::factory()` returns `GraphQLClientCreate`
28+
2. `GraphQLClientCreate::create($authenticator)` returns `GraphQLClientMethods`
29+
3. `GraphQLClientMethods` provides the API: `query()`, `mutate()`, bulk operations
30+
31+
### Key Components
32+
33+
**Core Classes** (`src/`):
34+
- `GraphQLClientMethods`: Main API facade with `query()`, `mutate()`, and bulk operation methods
35+
- `GraphQLClientTransformer`: Response wrapper with `toArray()`, `toCollection()`, `toDTO()` methods
36+
37+
**Services** (`src/Services/`):
38+
- `RequestExecutor`: Centralized request handling with rate limit tracking and retry logic
39+
- `ThrottleDetector`: Detects Shopify API throttling from responses
40+
- `RedisRateLimitService` / `NullRateLimitService`: Rate limit tracking implementations
41+
- `QueryTransformer`: GraphQL query pagination transformation
42+
43+
**Contracts** (`src/Contracts/`):
44+
- `RateLimitable`: Interface for rate limit services
45+
- `ThrottleDetectable`: Interface for throttle detection
46+
47+
**Data Objects** (`src/Data/`):
48+
- `RateLimitState`: Immutable value object for rate limit information
49+
50+
**Enums** (`src/Enums/`):
51+
- `ResponsePath`: Maps response types to their data extraction paths
52+
- `GraphQLRequestType`: Query vs Mutation type
53+
54+
**GraphQL** (`src/GraphQL/`):
55+
- `BulkOperationQueries`: Centralized GraphQL query templates for bulk operations
56+
57+
**Integrations** (`src/Integrations/`):
58+
- `ShopifyConnector`: Saloon connector handling base URL, auth, and failure detection
59+
- `Requests/`: Saloon request classes (Query, Mutation, BulkOperation, etc.)
60+
61+
**Authenticators** (`src/Authenticators/`):
62+
- `ShopifyApp`: Handles shop domain and access token validation
63+
64+
### Design Patterns
65+
66+
- **Factory pattern**: `GraphQLClient::factory()->create($authenticator)`
67+
- **Value objects**: `RateLimitState` for immutable rate limit data
68+
- **Strategy pattern**: `RateLimitable` and `ThrottleDetectable` contracts allow swapping implementations
69+
- **Template method**: Request classes extend `BaseRequest` with `defaultBody()` implementation
70+
71+
## Configuration
72+
73+
Published to `config/shopify-graphql.php`:
74+
- `api_version`: Shopify API version (default: 2025-01)
75+
- `fail_on_throttled`: Whether to fail immediately on throttle (default: true)
76+
- `throttle_max_tries`: Retry attempts before failing (default: 5)
77+
78+
## Testing
79+
80+
Uses Pest with Orchestra Testbench. Tests extend `TestCase` which registers the service provider.

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
],
1818
"require": {
1919
"php": "^8.3",
20-
"illuminate/contracts": "^11.0|^12.0",
20+
"illuminate/contracts": "^12.0",
2121
"saloonphp/saloon": "^3.8",
2222
"spatie/laravel-package-tools": "^1.16",
2323
"webonyx/graphql-php": "^15.19"
@@ -27,7 +27,7 @@
2727
"larastan/larastan": "^v3.0.0",
2828
"laravel/pint": "^1.15",
2929
"nunomaduro/collision": "^8.1.1",
30-
"orchestra/testbench": "^9.0.0|^10.0.0",
30+
"orchestra/testbench": "^10.0.0",
3131
"pestphp/pest": "^v4.1.6",
3232
"pestphp/pest-plugin-arch": "^v4.0.0",
3333
"pestphp/pest-plugin-laravel": "^v4.0.0",

0 commit comments

Comments
 (0)