Skip to main content
View as Markdown

Naming conventions

Names in the Octopart API follow a few patterns. Once you know them, the operation you need is usually easy to guess.

Prefixes​

Every operation and type name starts with the domain that owns it, then the area within that domain:

PrefixDomainExamples
sup / SupSupply datasupSearch, SupPart, SupOffer
supPartFamily, supPartGroupPart familiessupPartFamilySearch, SupPartGroup
supRefReference designssupRefDesignById, SupRefDesign
supSolutionTemplateSolution templatessupSolutionTemplateById, SupSolutionTemplate
supEvalKitEvaluation kitssupEvalKitById, SupEvalKit
supSoftwareProjectSoftware projectssupSoftwareProjectById, SupSoftwareProject
datBom / DatBomProcurement: BOM analysisdatBomParts, DatBomPart

Search on this site ignores the prefixes: typing part family finds SupPartFamily.

Queries​

PatternReturnsExample
…ById(id:)One item, or nullsupRefDesignById, supSolutionTemplateById
…ByIds(ids:)A listsupSolutionTemplatesByIds, supSoftwareProjectsByIds
…ByName(name:)One itemsupRefDesignByName, supPartGroupByName
…SearchA result set or a connectionsupPartFamilySearch, supSolutionTemplateSearch

For parts, supParts(ids:) looks up by Octopart part id, and supSearchMpn and supMultiMatch look up by manufacturer part number:

query PartsByIdAndMpn {
supParts(ids: ["39619421"]) {
id
mpn
}
supMultiMatch(queries: [{ mpn: "LM358", start: 0, limit: 1 }]) {
hits
parts {
id
mpn
}
}
}

Mutations​

Mutations take a single input argument of type …Input! and return a …Payload!:

SDL
type Mutation {
supSolutionTemplateSetTags(input: SupSolutionTemplateSetTagsInput!): SupSolutionTemplateSetTagsPayload!
}

Collections of a solution template, an evaluation kit or a software project have two mutations:

  • Set replaces the whole collection: supSolutionTemplateSetTags takes the full tags list.
  • Patch adds and removes items: supSolutionTemplatePatchTags takes addTags and removeTags.

Payloads carry an errors list typed as a union of the errors that the mutation can return. See Errors.


Comments​