Commit 5e9facc
Mattia Baldari
Fix compatibility with graphql-core 3.2.7+ using TypeFields
Prior to this change, schemadiff failed to import with graphql-core
3.2.7+ because TypeResolvers was removed from the public API.
This change creates the _get_type_resolvers() helper to use TypeFields,
the official replacement class introduced in graphql-core 3.2.7, with
graceful fallback to older import strategies.
The fallback order is:
1. Try TypeFields (official, graphql-core >= 3.2.7)
2. Try TypeResolvers (legacy, graphql-core 3.2.0-3.2.6)
3. Try TypeFieldResolvers (legacy, graphql-core < 3.2.0)
Benefits:
- Uses official TypeFields class per maintainer recommendation
- Maintains backward compatibility with all graphql-core versions
- Simpler and more maintainable than reconstructing from introspection
- Better performance using native classes
References:
graphql-python/graphql-core#246 (comment)1 parent 7581e38 commit 5e9facc
1 file changed
+29
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | 11 | | |
17 | 12 | | |
18 | 13 | | |
| |||
32 | 27 | | |
33 | 28 | | |
34 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
35 | 59 | | |
36 | 60 | | |
37 | 61 | | |
| |||
0 commit comments