Commit f66e405
authored
chore: Android Move graphql queries in the code (#507)
## Summary
Move graphql queries into code files not load them every time in
runtime, weirdly it helps to make code compatibkle with .NET10 and
usable in the Java server code.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Medium risk because it changes the public `GraphQLClient.execute`
signature and shifts query text from resources to code, where string
formatting/escaping mistakes could break production GraphQL calls.
>
> **Overview**
> **GraphQL queries are now inlined in code instead of loaded from
resources at runtime.** `GraphQLClient.execute` now takes a `query:
String` and the internal `loadQuery` resource loader is removed.
>
> `SamplingApiService` and `SessionReplayApiService` embed their GraphQL
operations as Kotlin multiline strings and pass them directly to
`execute`, and the corresponding `.graphql` resource files (plus the
test query resource) are deleted. Tests are updated accordingly,
including removing the missing-file test case and adjusting mocks to
accept the new `execute` parameter.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
ffa3cc6. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent a9907a7 commit f66e405
10 files changed
Lines changed: 200 additions & 218 deletions
File tree
- sdk/@launchdarkly/observability-android/lib/src
- main
- kotlin/com/launchdarkly/observability
- network
- replay/exporter
- resources/graphql
- test
- kotlin/com/launchdarkly/observability/network
- resources
Lines changed: 2 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
84 | 83 | | |
85 | 84 | | |
86 | 85 | | |
| |||
143 | 142 | | |
144 | 143 | | |
145 | 144 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | 145 | | |
158 | 146 | | |
159 | 147 | | |
| |||
Lines changed: 56 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 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 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
15 | 69 | | |
16 | 70 | | |
17 | 71 | | |
| |||
23 | 77 | | |
24 | 78 | | |
25 | 79 | | |
26 | | - | |
| 80 | + | |
27 | 81 | | |
28 | 82 | | |
29 | 83 | | |
| |||
Lines changed: 128 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | | - | |
| 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 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
32 | 154 | | |
33 | 155 | | |
34 | 156 | | |
| |||
54 | 176 | | |
55 | 177 | | |
56 | 178 | | |
57 | | - | |
| 179 | + | |
58 | 180 | | |
59 | 181 | | |
60 | 182 | | |
| |||
78 | 200 | | |
79 | 201 | | |
80 | 202 | | |
81 | | - | |
| 203 | + | |
82 | 204 | | |
83 | 205 | | |
84 | 206 | | |
| |||
124 | 246 | | |
125 | 247 | | |
126 | 248 | | |
127 | | - | |
| 249 | + | |
128 | 250 | | |
129 | 251 | | |
130 | 252 | | |
| |||
Lines changed: 0 additions & 53 deletions
This file was deleted.
Lines changed: 0 additions & 11 deletions
This file was deleted.
0 commit comments