attio 0.0.1-experimental.20241008 → 0.0.1-experimental.20241008.2

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.
@@ -8,7 +8,6 @@ const connectionDefinitionsResponseSchema = z.object({
8
8
  connection_type: z.enum(["oauth2-code", "secret"]),
9
9
  description: z.string().nullable(),
10
10
  global: z.boolean(),
11
- allow_multiple: z.boolean(),
12
11
  })),
13
12
  });
14
13
  export async function fetchConnections({ token, devSlug, appId, major, }) {
@@ -43,10 +43,9 @@ export default function ListConnections({ options: { dev } }) {
43
43
  snapshot.context.connections &&
44
44
  snapshot.context.connections && (React.createElement(Box, null,
45
45
  React.createElement(Table, { rows: Object.entries(snapshot.context.connections).map(([slug, connection]) => ({
46
- "Slug": slug,
47
- "Label": connection.label,
48
- "Global": connection.global ? "Yes" : "No",
49
- "Allow Multiple": connection.allow_multiple ? "Yes" : "No",
50
- "Type": connectionTypeNames[connection.connection_type],
46
+ Slug: slug,
47
+ Label: connection.label,
48
+ Global: connection.global ? "Yes" : "No",
49
+ Type: connectionTypeNames[connection.connection_type],
51
50
  })) })))));
52
51
  }
@@ -110,7 +110,9 @@ function generateReturnType(selectionSet, schema) {
110
110
  return generateTypeDefinitionFromSelectionSet(selectionSet, queryType);
111
111
  }
112
112
  function generateOperationFunction(graphqlFileName, operationName, variableDefinitions, schema, selectionSet) {
113
- const typeName = `${operationName.charAt(0).toUpperCase() + operationName.slice(1)}`;
113
+ const typeName = operationName === null
114
+ ? ""
115
+ : `${operationName.charAt(0).toUpperCase() + operationName.slice(1)}`;
114
116
  const returnType = generateReturnType(selectionSet, schema);
115
117
  let input;
116
118
  const variables = variableDefinitions
@@ -158,24 +160,20 @@ export async function generateOperationFromQuery(graphqlFileName, query, schema)
158
160
  }
159
161
  visit(ast, {
160
162
  OperationDefinition(node) {
161
- if (node.name) {
162
- switch (node.operation) {
163
- case OperationTypeNode.MUTATION:
164
- case OperationTypeNode.SUBSCRIPTION:
165
- throw new GraphQLError(`Only queries are supported, found ${node.operation}`, node.loc ? [getLineAndColumn(query, node.loc)] : [{ line: 1, column: 1 }], query, graphqlFileName);
166
- case OperationTypeNode.QUERY:
167
- if (operation) {
168
- throw new GraphQLError(`Only one query is allowed per .graphql file`, node.loc
169
- ? [getLineAndColumn(query, node.loc)]
170
- : [{ line: 1, column: 1 }], query, graphqlFileName);
171
- }
172
- const operationName = node.name.value;
173
- const variableDefinitions = node.variableDefinitions || [];
174
- operation = generateOperationFunction(graphqlFileName, operationName, variableDefinitions, schema, node.selectionSet);
175
- break;
176
- default:
177
- return node.operation;
178
- }
163
+ switch (node.operation) {
164
+ case OperationTypeNode.MUTATION:
165
+ case OperationTypeNode.SUBSCRIPTION:
166
+ throw new GraphQLError(`Only queries are supported, found ${node.operation}`, node.loc ? [getLineAndColumn(query, node.loc)] : [{ line: 1, column: 1 }], query, graphqlFileName);
167
+ case OperationTypeNode.QUERY:
168
+ if (operation) {
169
+ throw new GraphQLError(`Only one query is allowed per .graphql file`, node.loc ? [getLineAndColumn(query, node.loc)] : [{ line: 1, column: 1 }], query, graphqlFileName);
170
+ }
171
+ const operationName = node.name?.value ?? null;
172
+ const variableDefinitions = node.variableDefinitions || [];
173
+ operation = generateOperationFunction(graphqlFileName, operationName, variableDefinitions, schema, node.selectionSet);
174
+ break;
175
+ default:
176
+ return node.operation;
179
177
  }
180
178
  },
181
179
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attio",
3
- "version": "0.0.1-experimental.20241008",
3
+ "version": "0.0.1-experimental.20241008.2",
4
4
  "bin": "lib/attio.js",
5
5
  "type": "module",
6
6
  "files": [