<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Adam Miller</title>
    <description>The latest articles on DEV Community by Adam Miller (@adam_miller_54f62bd1e6263).</description>
    <link>https://dev.to/adam_miller_54f62bd1e6263</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2136547%2F17a6a899-ded7-4ece-b6bb-032689206217.png</url>
      <title>DEV Community: Adam Miller</title>
      <link>https://dev.to/adam_miller_54f62bd1e6263</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/adam_miller_54f62bd1e6263"/>
    <language>en</language>
    <item>
      <title>Looking for a job as a Software Engineer</title>
      <dc:creator>Adam Miller</dc:creator>
      <pubDate>Tue, 01 Oct 2024 02:22:10 +0000</pubDate>
      <link>https://dev.to/adam_miller_54f62bd1e6263/looking-for-a-job-as-a-software-engineer-3e61</link>
      <guid>https://dev.to/adam_miller_54f62bd1e6263/looking-for-a-job-as-a-software-engineer-3e61</guid>
      <description>&lt;p&gt;I'm Adam Miller,  a senior Software engineer have over 7 years of experience.&lt;br&gt;
And now seeking a new remote job opportunity. Anyone can help me to do that?&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Planning to Integrate Apollo GraphQL with Jetpack Compose? Here's a Complete Guide</title>
      <dc:creator>Adam Miller</dc:creator>
      <pubDate>Fri, 27 Sep 2024 18:55:11 +0000</pubDate>
      <link>https://dev.to/adam_miller_54f62bd1e6263/integrating-apollo-graphql-into-a-jetpack-compose-project-3ci2</link>
      <guid>https://dev.to/adam_miller_54f62bd1e6263/integrating-apollo-graphql-into-a-jetpack-compose-project-3ci2</guid>
      <description>&lt;h2&gt;
  
  
  Are you planning to incorporate Apollo GraphQL into a Jetpack Compose project? This guide will take you through the process step-by-step. For a complete implementation using Clean Architecture, be sure to visit my &lt;a href="https://github.com/adamiller1014/FiloDiscuss_source" rel="noopener noreferrer"&gt;GitHub &lt;/a&gt;repository.
&lt;/h2&gt;

&lt;p&gt;&amp;amp; It will be looks like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff796pwprsoi95r7izn9w.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff796pwprsoi95r7izn9w.jpg" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Project Setup&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Modify app/build.gradle.kts: To begin, include the Apollo plugin:&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    // ...
    alias(libs.plugins.apollo3Graph)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, add Apollo runtime to your dependencies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dependencies {
    // Existing dependencies
    implementation(libs.apollo.runtime)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Edit libs.versions.toml: Define Apollo's version and libraries:&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[versions]
apollo3 = "3.8.5"

[libraries]
apollo-runtime = { group = "com.apollographql.apollo3", name = "apollo-runtime" }
apollo-api = { group = "com.apollographql.apollo3", name = "apollo-api" }

[plugins]
apollo3Graph = { id = "com.apollographql.apollo3", version.ref = "apollo3" }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Set Package for Generated Code: Specify the package for generated Kotlin files by adding the following to your app/build.gradle.kts:&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    // Android block
    apollo {
        service("service") {
            packageName.set("com.example.appname")
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;GraphQL Schema Integration&lt;/strong&gt;&lt;br&gt;
Download the GraphQL Schema: Obtain the schema from your server using the Apollo CLI. Run this command in Android Studio's terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./gradlew :app:downloadApolloSchema --endpoint='http://localhost:4000/graphql' --schema=app/src/main/graphql/schema.graphqls

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;The schema will be saved in app/src/main/graphql/.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;First GraphQL Query&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add Your First Query: Create a new GraphQL file in src/main/graphql/. Here’s an example query to fetch posts:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;query Posts($limit: Int!, $cursor: String) {
    posts(limit: $limit, cursor: $cursor) {
        hasMore
        posts {
            id
            createdAt
            updatedAt
            title
            text
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Generate the Query Model: After building the project, check the generated model file at app/build/generated/source/apollo/service/com/example/appname/PostsQuery.kt.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Executing the Query&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create an Apollo Client: In Apollo.kt, create an instance of ApolloClient with your server's URL:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;val apolloClient = ApolloClient.Builder()
    .serverUrl("http://10.0.2.2:4000/graphql")
    .build()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Run the Query: Now, you can use the ApolloClient to execute the PostsQuery:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;val response = apolloClient.query(PostsQuery(limit = limit, cursor = Optional.present(cursor))).execute()
val posts = response.data?.posts?.posts?.filterNotNull() ?: emptyList()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
You've successfully integrated Apollo GraphQL with Jetpack Compose! If you're looking for more advanced features like implementing GraphQL with Clean Architecture, take a look at my GitHub repository. Keep coding, and enjoy the process!&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
