Comments (8)
I think I found your problem, in provideApiService
.addConverterFactory(GraphConverter.create(context, ILogger.Level.VERBOSE))
.addConverterFactory(GsonConverterFactory.create(GsonBuilder().create()))
Swap the order of graph converter and gson converter, otherwise retrofit will default to the Gson and you should see more loggs
2021-04-01 12:02:32.146 9534-9534/com.letrix.miranime V/GraphProcessor: main: has obtained a synchronized lock on the object
2021-04-01 12:02:32.146 9534-9534/com.letrix.miranime V/GraphProcessor: main: is initializing query files
2021-04-01 12:02:32.154 9534-9534/com.letrix.miranime V/GraphProcessor: main: has completed initializing all graphql files
2021-04-01 12:02:32.154 9534-9534/com.letrix.miranime V/GraphProcessor: main: discovered `3` graphql files
2021-04-01 12:02:32.250 9534-9569/com.letrix.miranime D/GraphProcessor: Looking up `.graphql` file matching: GetHome.graphql
N.B
GraphConverter
has factory methods to initialise everything you need e.g.GraphConverter.create(context, ILogger.Level.VERBOSE)
If you need GsonConverterFactory
for some other endpoints you could simply extend GraphConverter
and override requestBodyConverter
to provide a different converter for anything else that is not annotated with GraphQuery
on the methodAnnotations
from retrofit-graphql.
It worked! Thanks :)
from retrofit-graphql.
Hi, are you sure that the .graphql
file isn't being detected? Can you check the logcat as you make the request you should find the following output:
"The requested query annotated with value: `GetAnime` could not be found!"
If the file isn't found
from retrofit-graphql.
I wasn't getting any output, so I added this to my Retrofit builder:
addConverterFactory(GraphConverter(GraphProcessor(AssetManagerDiscoveryPlugin(assetManager = context.assets),logger = DefaultGraphLogger(ILogger.Level.VERBOSE)), Gson()))
Output:
V/GraphProcessor: main: has obtained a synchronized lock on the object
V/GraphProcessor: main: is initializing query files
V/GraphProcessor: main: has completed initializing all graphql files
V/GraphProcessor: main: discovered `1` graphql files
Running this I can get the first line of the file:
assets.open("GetAnime.graphql").bufferedReader().readLine()
from retrofit-graphql.
From the small snipet you have provided it looks like the file is found but at runtime somethings seems to be off, I have tried the sample project with the default converter: GraphConverter(...)
just to be sure that the issue isn't coming from there and that seems to be working fine, can you please provide a full log filtered by GraphProcessor
from the startup of your application to the point after you get the error Must provide query string
from retrofit-graphql.
I'm trying on another project and the same issue. This is all the logging I have and I only receive only those 4 lines from GraphProcessor.
MainActivity$onCreate
is where I called it using CoroutineScope(Dispatchers.IO).launch
logcat.txt
from retrofit-graphql.
Just out of curiosity, what does your assets folder structure look like, and do you mind sharing your second demo sample so I can take a look?
from retrofit-graphql.
This is the project I'm working it right now: https://github.com/LetrixZ/miranime
assets folder
ApiService Interface
Retrofit Builder
In the meantime, I'm using Apollo without problems.
from retrofit-graphql.
Related Issues (20)
- Dependabot couldn't find a build.gradle for this project HOT 1
- Dependabot couldn't find a build.gradle for this project HOT 1
- Dependabot couldn't find a build.gradle for this project HOT 1
- Drop minSdk to 17 again HOT 3
- Dependabot couldn't find a build.gradle for this project HOT 1
- Dependabot couldn't find a build.gradle for this project HOT 1
- Dependabot couldn't find a build.gradle for this project HOT 1
- Allow subclasses of QueryContainerBuilder for requests HOT 2
- Migrate to version cataloges for buildSrc
- Not able to read Fragment from fragment package. HOT 1
- Fragment not working for mutation. HOT 11
- Enable ProGuards Library not working HOT 5
- File Uploading HOT 8
- Filtering of the log messages does not work HOT 1
- Support Android libraries HOT 2
- Dynamic Selection Set at Runtime HOT 2
- Create custom converter with Moshi HOT 2
- Allow for Fragments to be defined in their own files. HOT 5
- Success and failure call back HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from retrofit-graphql.