graphql-decorate 1.0.3 → 1.0.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 332c718984dda5295c80630808cc5f03f89eac5ba0395edfb4642ab0d757aeda
4
- data.tar.gz: e7eb062bb4effd0083c8a329697d4410e4ae968444294608ff5b90bd2304534f
3
+ metadata.gz: b79924fe9758b0881143f50e7536b02958a88932be59b541545f56ab62fc2571
4
+ data.tar.gz: c2455d37d70dc7ff45d1fbe4eab2ae304437ad4c04d0f0cb4ef5912447c68308
5
5
  SHA512:
6
- metadata.gz: 6d37cc0239dbcfda3424d59102b658756c2660ddc72c4e719da8eb5e6b56a60c0c72c5bb3d7e53d1870bc669848a4e4cc3ff49105e8ece6c3ec19d3a5ebb4ad1
7
- data.tar.gz: b0227888e6b2d7cc8ab394e60b5e99bef9e1421fc57209ac7fca70aae5b078439d4e8b1bfee7e67d12d6e817ce2412562e9376278849e28aaeed851c71726759
6
+ metadata.gz: fa468e9077d6854f198045c2ad8ebc47bb07c9c63cc2e14d52b3f65693fe12c9dc2466787740c76c92ea98e4617b0c42cc39c72672f3c5dbc777291a259f66e2
7
+ data.tar.gz: 7372025f4fd3857dff61b875f9da3883030f5f1b43f406a985d76f74ca72c548d2df3cabf915a7979eecc8f66b8a8330849d1b7f1df43405fa4aba575185bc39
@@ -105,10 +105,19 @@ module GraphQL
105
105
  GraphQL::Decorate::TypeAttributes.new(type.resolve_type(value,
106
106
  graphql_context))
107
107
  else
108
- graphql_context.schema.resolve_type(type, value, graphql_context)
108
+ resolve_type_attributes_from_schema
109
109
  end
110
110
  end
111
111
  end
112
+
113
+ def resolve_type_attributes_from_schema
114
+ result = graphql_context.schema.resolve_type(type, value, graphql_context)
115
+ return result unless result.is_a?(Array) && result.size == 2
116
+
117
+ result[0]
118
+ .authorized_new(result[1], graphql_context)
119
+ .then(&GraphQL::Decorate::TypeAttributes.method(:new))
120
+ end
112
121
  end
113
122
  end
114
123
  end
@@ -3,6 +3,6 @@
3
3
  module GraphQL
4
4
  module Decorate
5
5
  # Current version number
6
- VERSION = '1.0.3'
6
+ VERSION = '1.0.4'
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql-decorate
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Brook
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-05-03 00:00:00.000000000 Z
11
+ date: 2022-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql