Diizzayy / nuxt-graphql-client

⚡️ Minimal GraphQL Client + Code Generation for Nuxt3
https://nuxt-graphql-client.web.app
MIT License
366 stars 44 forks source link

fix: detect default client if not first in config #238

Closed PanMisza closed 2 years ago

PanMisza commented 2 years ago

This PR resolves issue when default client is not defined as first one in clients.

❌ not working

clients: {
  cached: {
    host: GQL_HOST,
    schema: './config/introspection.json',
    preferGETQueries: false,
  },
  default: {
    host: GQL_HOST,
    schema: './config/introspection.json',
  },
},

Error: [vite-node] [VITE_ERROR] virtual:nuxt:./.nuxt/gql.mjs

✅ works

clients: {
  default: {
    host: GQL_HOST,
    schema: './config/introspection.json',
  },
  cached: {
    host: GQL_HOST,
    schema: './config/introspection.json',
    preferGETQueries: false,
  },
},
codecov[bot] commented 2 years ago

Codecov Report

Merging #238 (7948ab8) into main (e66a108) will not change coverage. The diff coverage is 100.00%.

:exclamation: Current head 7948ab8 differs from pull request most recent head 1217823. Consider uploading reports for the commit 1217823 to get more accurate results

@@           Coverage Diff           @@
##             main     #238   +/-   ##
=======================================
  Coverage   92.92%   92.92%           
=======================================
  Files           5        5           
  Lines         537      537           
  Branches      109      107    -2     
=======================================
  Hits          499      499           
  Misses         37       37           
  Partials        1        1           
Impacted Files Coverage Δ
src/utils.ts 100.00% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more