@graphql-codegen/cli 5.0.5-alpha-20250202125702-1b7cbef6b28bbd45d83b2facfa30c263cc369044 → 5.0.5-alpha-20250209134245-aad5521a961596a024c71a3d46b0882f5608b92b

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isURL = isURL;
4
+ function isURL(str) {
5
+ try {
6
+ const url = new URL(str);
7
+ return !!url;
8
+ }
9
+ catch {
10
+ return false;
11
+ }
12
+ }
@@ -7,6 +7,7 @@ const utils_1 = require("@graphql-tools/utils");
7
7
  const plugin_helpers_1 = require("@graphql-codegen/plugin-helpers");
8
8
  const is_glob_1 = tslib_1.__importDefault(require("is-glob"));
9
9
  const micromatch_1 = tslib_1.__importDefault(require("micromatch"));
10
+ const helpers_js_1 = require("./helpers.js");
10
11
  /**
11
12
  * Flatten a list of pattern sets to be a list of only the affirmative patterns
12
13
  * are contained in all of them.
@@ -149,7 +150,7 @@ const makePatternsFromSchemas = (schemas) => {
149
150
  const patterns = [];
150
151
  for (const s of schemas) {
151
152
  const schema = s;
152
- if ((0, is_glob_1.default)(schema) || (0, utils_1.isValidPath)(schema)) {
153
+ if (!(0, helpers_js_1.isURL)(schema) && ((0, is_glob_1.default)(schema) || (0, utils_1.isValidPath)(schema))) {
153
154
  patterns.push(schema);
154
155
  }
155
156
  }
@@ -0,0 +1,9 @@
1
+ export function isURL(str) {
2
+ try {
3
+ const url = new URL(str);
4
+ return !!url;
5
+ }
6
+ catch {
7
+ return false;
8
+ }
9
+ }
@@ -3,6 +3,7 @@ import { isValidPath } from '@graphql-tools/utils';
3
3
  import { normalizeInstanceOrArray } from '@graphql-codegen/plugin-helpers';
4
4
  import isGlob from 'is-glob';
5
5
  import mm from 'micromatch';
6
+ import { isURL } from './helpers.js';
6
7
  /**
7
8
  * Flatten a list of pattern sets to be a list of only the affirmative patterns
8
9
  * are contained in all of them.
@@ -141,7 +142,7 @@ const makePatternsFromSchemas = (schemas) => {
141
142
  const patterns = [];
142
143
  for (const s of schemas) {
143
144
  const schema = s;
144
- if (isGlob(schema) || isValidPath(schema)) {
145
+ if (!isURL(schema) && (isGlob(schema) || isValidPath(schema))) {
145
146
  patterns.push(schema);
146
147
  }
147
148
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-codegen/cli",
3
- "version": "5.0.5-alpha-20250202125702-1b7cbef6b28bbd45d83b2facfa30c263cc369044",
3
+ "version": "5.0.5-alpha-20250209134245-aad5521a961596a024c71a3d46b0882f5608b92b",
4
4
  "peerDependenciesMeta": {
5
5
  "@parcel/watcher": {
6
6
  "optional": true
@@ -14,9 +14,9 @@
14
14
  "@babel/generator": "^7.18.13",
15
15
  "@babel/template": "^7.18.10",
16
16
  "@babel/types": "^7.18.13",
17
- "@graphql-codegen/client-preset": "4.6.2-alpha-20250202125702-1b7cbef6b28bbd45d83b2facfa30c263cc369044",
18
- "@graphql-codegen/core": "4.0.3-alpha-20250202125702-1b7cbef6b28bbd45d83b2facfa30c263cc369044",
19
- "@graphql-codegen/plugin-helpers": "6.0.0-alpha-20250202125702-1b7cbef6b28bbd45d83b2facfa30c263cc369044",
17
+ "@graphql-codegen/client-preset": "^4.6.0",
18
+ "@graphql-codegen/core": "^4.0.2",
19
+ "@graphql-codegen/plugin-helpers": "^5.0.3",
20
20
  "@graphql-tools/apollo-engine-loader": "^8.0.0",
21
21
  "@graphql-tools/code-file-loader": "^8.0.0",
22
22
  "@graphql-tools/git-loader": "^8.0.0",
@@ -0,0 +1 @@
1
+ export declare function isURL(str: string): boolean;
@@ -0,0 +1 @@
1
+ export declare function isURL(str: string): boolean;